Send a "remove all user mode" MODE to clients when we lose the irc connections

Without this we could cause a client desync (ZNC still got the correct
information).

Bug reported by tomaw and patch provided by flakes, thanks.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1583 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
psychon
2009-08-01 08:59:06 +00:00
parent 16372a5830
commit 22bc2a6fa1

View File

@@ -830,6 +830,19 @@ void CIRCSock::Disconnected() {
m_pUser->ClearMotdBuffer();
ResetChans();
// send a "reset user modes" cmd to the client.
// otherwise, on reconnect, it might think it still
// had user modes that it actually doesn't have.
CString sUserMode;
for (set<unsigned char>::const_iterator it = m_scUserModes.begin(); it != m_scUserModes.end(); it++) {
sUserMode += *it;
}
if (!sUserMode.empty()) {
m_pUser->PutUser(":" + m_pUser->GetIRCNick().GetNickMask() + " MODE " + m_pUser->GetIRCNick().GetNick() + " :-" + sUserMode);
}
// also clear the user modes in our space:
m_scUserModes.clear();
}