Added support for buffering of /me actions

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@602 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
prozacx
2006-02-01 07:45:54 +00:00
parent 9d8bb77de7
commit 2cd52ad39a
2 changed files with 18 additions and 8 deletions
+12 -3
View File
@@ -383,11 +383,20 @@ void CClient::ReadLine(const CString& sData) {
return;
}
CChan* pChan = m_pUser->FindChan(sTarget);
if (sCTCP.Token(0).CaseCmp("ACTION") == 0) {
if (pChan && pChan->KeepBuffer()) {
pChan->AddBuffer(":" + GetNickMask() + " PRIVMSG " + sTarget + " :\001" + sCTCP + "\001");
}
#ifdef _MODULES
CZNC::Get().GetModules().SetClient(this);
MODULECALLRET(OnUserCTCP(sTarget, sCTCP));
CZNC::Get().GetModules().SetClient(NULL);
} else {
CZNC::Get().GetModules().SetClient(this);
MODULECALLRET(OnUserCTCP(sTarget, sCTCP));
CZNC::Get().GetModules().SetClient(NULL);
#endif
}
PutIRC("PRIVMSG " + sTarget + " :\001" + sCTCP + "\001");
return;
}
+6 -5
View File
@@ -716,14 +716,15 @@ bool CIRCSock::OnPrivMsg(CNick& Nick, CString& sMessage) {
bool CIRCSock::OnChanCTCP(CNick& Nick, const CString& sChan, CString& sMessage) {
CChan* pChan = m_pUser->FindChan(sChan);
if (pChan) {
MODULECALL(OnChanCTCP(Nick, *pChan, sMessage));
if (pChan->IsDetached()) {
return true;
// Record a /me
if (sMessage.Token(0).CaseCmp("ACTION") == 0 && (pChan->KeepBuffer() || !m_pUser->IsUserAttached())) {
pChan->AddBuffer(":" + Nick.GetNickMask() + " PRIVMSG " + sChan + " :\001" + sMessage + "\001");
} else {
MODULECALL(OnChanCTCP(Nick, *pChan, sMessage));
}
}
return false;
return (pChan && pChan->IsDetached());
}
bool CIRCSock::OnChanNotice(CNick& Nick, const CString& sChan, CString& sMessage) {