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
This commit is contained in:
psychon
2009-04-09 08:22:20 +00:00
parent 2f64dffee3
commit 424e6c1820
+13 -6
View File
@@ -129,7 +129,7 @@ public:
virtual EModRet OnDeleteUser(CUser& User) {
// Loop through each chan
for (set<CPartylineChannel*>::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;