From 9f76ab644ce8a4ebc3ab288a4a8b971b87bd94f0 Mon Sep 17 00:00:00 2001 From: Tomatix Date: Wed, 2 Dec 2020 22:17:50 +0100 Subject: [PATCH] Added event "away" for IRCv3 away messages. --- IdealIRC/IRC.cpp | 1 + IdealIRC/ScriptEvent.h | 1 + 2 files changed, 2 insertions(+) diff --git a/IdealIRC/IRC.cpp b/IdealIRC/IRC.cpp index 215d0f1..3ff6f40 100644 --- a/IdealIRC/IRC.cpp +++ b/IdealIRC/IRC.cpp @@ -800,6 +800,7 @@ void IRC::v3onMsgAway(const IRCPrefix& sender, const std::string& message, const for (const auto& channel : channelsAffected) getStatus().printTo(channel.c_str(), PrintType::ServerInfo, msg.c_str()); } + contextualScriptEvent(&m_status, ScriptEvent::Away, sender.toString(), message); } void IRC::v3onMsgJoin(const IRCPrefix& sender, const std::string& channel, const std::string& useraccount, const std::string& realname) diff --git a/IdealIRC/ScriptEvent.h b/IdealIRC/ScriptEvent.h index 495ab52..29ac09f 100644 --- a/IdealIRC/ScriptEvent.h +++ b/IdealIRC/ScriptEvent.h @@ -22,6 +22,7 @@ namespace ScriptEvent { constexpr auto* Kill = "kill"; constexpr auto* Error = "error"; constexpr auto* Numeric = "numeric"; + constexpr auto* Away = "away"; // IRCv3 only } #endif // SCRIPTEVENTS_H