X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_callerid.cpp;h=f2cf112bf6581b15f2b0200286da651f5821dc3e;hb=b4599531f97a9e6207b6bb8d728d7523b6995523;hp=edf9d6c8e2c52a04cf6e7e79870c0d1d49f7d730;hpb=cbb6b376c781024534d4ece31a4b5296894d7390;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_callerid.cpp b/src/modules/m_callerid.cpp index edf9d6c8e..f2cf112bf 100644 --- a/src/modules/m_callerid.cpp +++ b/src/modules/m_callerid.cpp @@ -22,6 +22,7 @@ #include "inspircd.h" #include "modules/callerid.h" +#include "modules/ctctags.h" enum { @@ -345,7 +346,9 @@ class CallerIDAPIImpl : public CallerID::APIBase }; -class ModuleCallerID : public Module +class ModuleCallerID + : public Module + , public CTCTags::EventListener { CommandAccept cmd; CallerIDAPIImpl api; @@ -380,7 +383,8 @@ class ModuleCallerID : public Module public: ModuleCallerID() - : cmd(this) + : CTCTags::EventListener(this) + , cmd(this) , api(this, cmd.extInfo) , myumode(this, "callerid", 'g') { @@ -397,7 +401,7 @@ public: tokens["CALLERID"] = ConvToStr(myumode.GetModeChar()); } - ModResult OnUserPreMessage(User* user, const MessageTarget& target, MessageDetails& details) CXX11_OVERRIDE + ModResult HandleMessage(User* user, const MessageTarget& target) { if (!IS_LOCAL(user) || target.type != MessageTarget::TYPE_USER) return MOD_RES_PASSTHRU; @@ -427,6 +431,16 @@ public: return MOD_RES_PASSTHRU; } + ModResult OnUserPreMessage(User* user, const MessageTarget& target, MessageDetails& details) CXX11_OVERRIDE + { + return HandleMessage(user, target); + } + + ModResult OnUserPreTagMessage(User* user, const MessageTarget& target, CTCTags::TagMessageDetails& details) CXX11_OVERRIDE + { + return HandleMessage(user, target); + } + void OnUserPostNick(User* user, const std::string& oldnick) CXX11_OVERRIDE { if (!tracknick)