mirror of
https://github.com/znc/znc.git
synced 2026-03-28 17:42:41 +01:00
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:
@@ -1154,13 +1154,20 @@ void CIRCSock::TrySend() {
|
||||
m_iSendsAllowed--;
|
||||
bool bSkip = false;
|
||||
CString& sLine = m_vsSendQueue.front();
|
||||
IRCSOCKMODULECALL(OnSendToIRC(sLine), &bSkip);
|
||||
|
||||
CMessage Message(sLine);
|
||||
Message.SetNetwork(m_pNetwork);
|
||||
IRCSOCKMODULECALL(OnSendToIRCMessage(Message), &bSkip);
|
||||
|
||||
if (!bSkip) {
|
||||
;
|
||||
DEBUG("(" << m_pNetwork->GetUser()->GetUserName() << "/"
|
||||
<< m_pNetwork->GetName() << ") ZNC -> IRC [" << sLine
|
||||
<< "]");
|
||||
Write(sLine + "\r\n");
|
||||
CString sCopy = Message.ToString();
|
||||
IRCSOCKMODULECALL(OnSendToIRC(sCopy), &bSkip);
|
||||
if (!bSkip) {
|
||||
DEBUG("(" << m_pNetwork->GetUser()->GetUserName() << "/"
|
||||
<< m_pNetwork->GetName() << ") ZNC -> IRC [" << sCopy
|
||||
<< "]");
|
||||
Write(sCopy + "\r\n");
|
||||
}
|
||||
}
|
||||
m_vsSendQueue.pop_front();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user