summaryrefslogtreecommitdiff
path: root/src/modules.cpp
diff options
context:
space:
mode:
authorPeter Powell <petpow@saberuk.com>2017-12-11 19:42:52 +0000
committerPeter Powell <petpow@saberuk.com>2018-01-06 14:18:21 +0000
commit2fcb5ff4389a9a82d253acdff02a388ddcf14653 (patch)
tree96feee81599adb7ef02bc35293daccba7071a6de /src/modules.cpp
parent40514d0ba8279309f350a47652fffef745662926 (diff)
Rework message handling.
- Move all message-related types to their own header to make moving them to a cross-module events easier. - Rename OnUserMessage to OnUserPostMessage. - Rename OnText to OnUserMessage. - Replace the dest, target_type, and status parameters with the MessageTarget class. - Replace the text, exempt_list, and msgtype parameters with the MessageDetails struct. - Add echooriginal and originaltext to the MessageDetails struct to allow spam filtering to not be broken by cap echo-message.
Diffstat (limited to 'src/modules.cpp')
-rw-r--r--src/modules.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/modules.cpp b/src/modules.cpp
index f204f3fc1..ec793c64f 100644
--- a/src/modules.cpp
+++ b/src/modules.cpp
@@ -84,7 +84,7 @@ void Module::OnOper(User*, const std::string&) { DetachEvent(I_OnOper); }
void Module::OnPostOper(User*, const std::string&, const std::string &) { DetachEvent(I_OnPostOper); }
void Module::OnInfo(User*) { DetachEvent(I_OnInfo); }
ModResult Module::OnUserPreInvite(User*, User*, Channel*, time_t) { DetachEvent(I_OnUserPreInvite); return MOD_RES_PASSTHRU; }
-ModResult Module::OnUserPreMessage(User*, void*, int, std::string&, char, CUList&, MessageType) { DetachEvent(I_OnUserPreMessage); return MOD_RES_PASSTHRU; }
+ModResult Module::OnUserPreMessage(User*, const MessageTarget&, MessageDetails&) { DetachEvent(I_OnUserPreMessage); return MOD_RES_PASSTHRU; }
ModResult Module::OnUserPreNick(LocalUser*, const std::string&) { DetachEvent(I_OnUserPreNick); return MOD_RES_PASSTHRU; }
void Module::OnUserPostNick(User*, const std::string&) { DetachEvent(I_OnUserPostNick); }
ModResult Module::OnPreMode(User*, User*, Channel*, Modes::ChangeList&) { DetachEvent(I_OnPreMode); return MOD_RES_PASSTHRU; }
@@ -113,7 +113,7 @@ ModResult Module::OnChangeLocalUserGECOS(LocalUser*, const std::string&) { Detac
ModResult Module::OnPreTopicChange(User*, Channel*, const std::string&) { DetachEvent(I_OnPreTopicChange); return MOD_RES_PASSTHRU; }
ModResult Module::OnPassCompare(Extensible* ex, const std::string &password, const std::string &input, const std::string& hashtype) { DetachEvent(I_OnPassCompare); return MOD_RES_PASSTHRU; }
void Module::OnPostConnect(User*) { DetachEvent(I_OnPostConnect); }
-void Module::OnUserMessage(User*, void*, int, const std::string&, char, const CUList&, MessageType) { DetachEvent(I_OnUserMessage); }
+void Module::OnUserPostMessage(User*, const MessageTarget&, const MessageDetails&) { DetachEvent(I_OnUserPostMessage); }
void Module::OnUserInvite(User*, User*, Channel*, time_t, unsigned int, CUList&) { DetachEvent(I_OnUserInvite); }
void Module::OnPostTopicChange(User*, Channel*, const std::string&) { DetachEvent(I_OnPostTopicChange); }
void Module::OnDecodeMetaData(Extensible*, const std::string&, const std::string&) { DetachEvent(I_OnDecodeMetaData); }
@@ -130,7 +130,7 @@ ModResult Module::OnSetAway(User*, const std::string &) { DetachEvent(I_OnSetAwa
void Module::OnBuildNeighborList(User*, IncludeChanList&, std::map<User*,bool>&) { DetachEvent(I_OnBuildNeighborList); }
void Module::OnGarbageCollect() { DetachEvent(I_OnGarbageCollect); }
ModResult Module::OnSetConnectClass(LocalUser* user, ConnectClass* myclass) { DetachEvent(I_OnSetConnectClass); return MOD_RES_PASSTHRU; }
-void Module::OnText(User*, void*, int, const std::string&, char, CUList&) { DetachEvent(I_OnText); }
+void Module::OnUserMessage(User*, const MessageTarget&, const MessageDetails&) { DetachEvent(I_OnUserMessage); }
ModResult Module::OnNamesListItem(User*, Membership*, std::string&, std::string&) { DetachEvent(I_OnNamesListItem); return MOD_RES_PASSTHRU; }
ModResult Module::OnNumeric(User*, const Numeric::Numeric&) { DetachEvent(I_OnNumeric); return MOD_RES_PASSTHRU; }
ModResult Module::OnAcceptConnection(int, ListenSocket*, irc::sockets::sockaddrs*, irc::sockets::sockaddrs*) { DetachEvent(I_OnAcceptConnection); return MOD_RES_PASSTHRU; }