mirror of
https://github.com/znc/znc.git
synced 2026-03-28 17:42:41 +01:00
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:
13
IRCSock.cpp
13
IRCSock.cpp
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user