Add OnSendToIRCMessage and OnSendToClientMessage

This also alters PutClient such that the CMessage variant handles
sending messages, rather than the CString variant. As a side bonus, this
gives callers better information on whether the message was sent to the
client. Additionally, it eliminates the need for a hook to let modules
set the tags sent to a client, as that can now be done inside
OnSendToClientMessage.
This commit is contained in:
Eli Young
2017-04-11 13:03:38 -07:00
parent f37aa308e1
commit 823ac07240
13 changed files with 123 additions and 26 deletions

View File

@@ -97,6 +97,8 @@ EModRet OnChanTextMessage(CTextMessage& Message)
EModRet OnPrivNoticeMessage(CNoticeMessage& Message)
EModRet OnChanNoticeMessage(CNoticeMessage& Message)
EModRet OnTopicMessage(CTopicMessage& Message)
EModRet OnSendToClientMessage(CMessage& Message)
EModRet OnSendToIRCMessage(CMessage& Message)
EModRet OnAddUser(CUser& User, CString& sErrorRet)
EModRet OnDeleteUser(CUser& User)

View File

@@ -173,6 +173,8 @@ class ZNC_EXPORT_LIB_EXPORT CPyModule : public CModule {
EModRet OnPrivNoticeMessage(CNoticeMessage& Message) override;
EModRet OnChanNoticeMessage(CNoticeMessage& Message) override;
EModRet OnTopicMessage(CTopicMessage& Message) override;
EModRet OnSendToClientMessage(CMessage& Message) override;
EModRet OnSendToIRCMessage(CMessage& Message) override;
// Global Modules
EModRet OnAddUser(CUser& User, CString& sErrorRet) override;

View File

@@ -655,6 +655,12 @@ class Module:
def OnUnknownUserRawMessage(self, msg):
pass
def OnSendToClientMessage(self, msg):
pass
def OnSendToIRCMessage(self, msg):
pass
def make_inherit(cl, parent, attr):
def make_caller(parent, name, attr):