From 9170991a5ec3c22b6504c9d77f63437d866fad6c Mon Sep 17 00:00:00 2001 From: prozacx Date: Sat, 16 Sep 2006 20:27:57 +0000 Subject: [PATCH] Patched using forward_msgs_to_other_clients.patch by psycho git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@770 726aef4b-f618-498e-8847-2d620e286838 --- Client.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/Client.cpp b/Client.cpp index 7c7567b5..2b7c632f 100644 --- a/Client.cpp +++ b/Client.cpp @@ -252,6 +252,19 @@ void CClient::ReadLine(const CString& sData) { pChan->AddBuffer(":" + GetNickMask() + " NOTICE " + sTarget + " :" + sMsg); } + // Relay to the rest of the clients that may be connected to this user + if (m_pUser && m_pUser->IsChan(sTarget)) { + vector& vClients = m_pUser->GetClients(); + + for (unsigned int a = 0; a < vClients.size(); a++) { + CClient* pClient = vClients[a]; + + if (pClient != this) { + pClient->PutClient(":" + GetNickMask() + " NOTICE " + sTarget + " :" + sMsg); + } + } + } + PutIRC("NOTICE " + sTarget + " :" + sMsg); return; } else if (sCommand.CaseCmp("PRIVMSG") == 0) { @@ -383,6 +396,19 @@ void CClient::ReadLine(const CString& sData) { if (pChan && pChan->KeepBuffer()) { pChan->AddBuffer(":" + GetNickMask() + " PRIVMSG " + sTarget + " :\001" + sCTCP + "\001"); } + + // Relay to the rest of the clients that may be connected to this user + if (m_pUser && m_pUser->IsChan(sTarget)) { + vector& vClients = m_pUser->GetClients(); + + for (unsigned int a = 0; a < vClients.size(); a++) { + CClient* pClient = vClients[a]; + + if (pClient != this) { + pClient->PutClient(":" + GetNickMask() + " PRIVMSG " + sTarget + " :\001" + sCTCP + "\001"); + } + } + } #ifdef _MODULES } else { MODULECALL(OnUserCTCP(sTarget, sCTCP), m_pUser, this, return);