aboutsummaryrefslogtreecommitdiff
path: root/src/modules/m_ircv3.cpp
diff options
context:
space:
mode:
authorGravatar delthas2022-11-02 13:18:37 +0100
committerGravatar GitHub2022-11-02 12:18:37 +0000
commit6939a79a67d863ee9585b40b6c4af3bcaacf6a17 (patch)
tree06d1332b338b96889a18a35d2fd3414f272b536a /src/modules/m_ircv3.cpp
parentBump microsoft/setup-msbuild from 1.0.2 to 1.1.3 (diff)
Add support for the IRCv3 extended-monitor specification.
Co-authored-by: Sadie Powell <sadie@witchery.services>
Diffstat (limited to 'src/modules/m_ircv3.cpp')
-rw-r--r--src/modules/m_ircv3.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/modules/m_ircv3.cpp b/src/modules/m_ircv3.cpp
index 4c13a79c0..737fea280 100644
--- a/src/modules/m_ircv3.cpp
+++ b/src/modules/m_ircv3.cpp
@@ -23,6 +23,7 @@
#include "modules/away.h"
#include "modules/cap.h"
#include "modules/ircv3.h"
+#include "modules/monitor.h"
class AwayMessage : public ClientProtocol::Message
{
@@ -120,6 +121,7 @@ class ModuleIRCv3
JoinHook joinhook;
ClientProtocol::EventProvider accountprotoev;
+ Monitor::API monitorapi;
public:
ModuleIRCv3()
@@ -128,6 +130,7 @@ class ModuleIRCv3
, cap_accountnotify(this, "account-notify")
, joinhook(this)
, accountprotoev(this, "ACCOUNT")
+ , monitorapi(this)
{
}
@@ -150,7 +153,8 @@ class ModuleIRCv3
const std::string& param = (newaccount.empty() ? joinhook.asterisk : newaccount);
msg.PushParamRef(param);
ClientProtocol::Event accountevent(accountprotoev, msg);
- IRCv3::WriteNeighborsWithCap(user, accountevent, cap_accountnotify, true);
+ IRCv3::WriteNeighborsWithCap res(user, accountevent, cap_accountnotify, true);
+ Monitor::WriteWatchersWithCap(monitorapi, user, accountevent, cap_accountnotify, res.GetAlreadySentId());
}
void OnUserAway(User* user) CXX11_OVERRIDE
@@ -161,7 +165,8 @@ class ModuleIRCv3
// Going away: n!u@h AWAY :reason
AwayMessage msg(user);
ClientProtocol::Event awayevent(joinhook.awayprotoev, msg);
- IRCv3::WriteNeighborsWithCap(user, awayevent, joinhook.awaycap);
+ IRCv3::WriteNeighborsWithCap res(user, awayevent, joinhook.awaycap);
+ Monitor::WriteWatchersWithCap(monitorapi, user, awayevent, joinhook.awaycap, res.GetAlreadySentId());
}
void OnUserBack(User* user) CXX11_OVERRIDE