From 424e6c1820d9734aadddbf4f9386250b3be0dcb7 Mon Sep 17 00:00:00 2001 From: psychon Date: Thu, 9 Apr 2009 08:22:20 +0000 Subject: [PATCH] partyline: Fix the KICK sent for deleted users Before this, the KICK message was missing a target which was kicked. Now the user kicks himself. :) Thanks to JoeK for reporting this bug. git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1486 726aef4b-f618-498e-8847-2d620e286838 --- modules/partyline.cpp | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/modules/partyline.cpp b/modules/partyline.cpp index cddbeab3..788bd25a 100644 --- a/modules/partyline.cpp +++ b/modules/partyline.cpp @@ -129,7 +129,7 @@ public: virtual EModRet OnDeleteUser(CUser& User) { // Loop through each chan for (set::iterator it = m_ssChannels.begin(); it != m_ssChannels.end(); it++) { - RemoveUser(&User, *it, "KICK", true, "User deleted"); + RemoveUser(&User, *it, "KICK", true, "User deleted", true); } return CONTINUE; @@ -273,7 +273,7 @@ public: } void RemoveUser(CUser* pUser, CPartylineChannel* pChannel, const CString& sCommand, - bool bForce = false, const CString& sMessage = "") { + bool bForce = false, const CString& sMessage = "", bool bNickAsTarget = false) { if (!pChannel || !pChannel->IsInChannel(pUser->GetUserName())) { return; } @@ -294,10 +294,17 @@ public: sHost = pUser->GetIRCNick().GetHost(); } - pUser->PutUser(":" + pUser->GetIRCNick().GetNickMask() + sCmd - + pChannel->GetName() + sMsg); - PutChan(ssNicks, ":?" + pUser->GetUserName() + "!" + pUser->GetIdent() + "@" + sHost - + sCmd + pChannel->GetName() + sMsg, false); + if (bNickAsTarget) { + pUser->PutUser(":" + pUser->GetIRCNick().GetNickMask() + sCmd + + pChannel->GetName() + " " + pUser->GetIRCNick().GetNick() + sMsg); + PutChan(ssNicks, ":?" + pUser->GetUserName() + "!" + pUser->GetIdent() + "@" + sHost + + sCmd + pChannel->GetName() + " ?" + pUser->GetUserName() + sMsg, false); + } else { + pUser->PutUser(":" + pUser->GetIRCNick().GetNickMask() + sCmd + + pChannel->GetName() + sMsg); + PutChan(ssNicks, ":?" + pUser->GetUserName() + "!" + pUser->GetIdent() + "@" + sHost + + sCmd + pChannel->GetName() + sMsg, false); + } if (ssNicks.empty()) { delete pChannel;