From 6939a79a67d863ee9585b40b6c4af3bcaacf6a17 Mon Sep 17 00:00:00 2001 From: delthas Date: Wed, 2 Nov 2022 13:18:37 +0100 Subject: Add support for the IRCv3 extended-monitor specification. Co-authored-by: Sadie Powell --- src/modules/m_ircv3.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/modules/m_ircv3.cpp') 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 -- cgit v1.3.1-10-gc9f91