Fix part/join not working when a client sends '/cycle' or '/hop' command.

This commit is contained in:
RealKindOne
2026-07-20 04:33:04 -04:00
parent 13268feefe
commit 3ceae3ad26
2 changed files with 24 additions and 0 deletions
+1
View File
@@ -1592,6 +1592,7 @@ bool CClient::OnPartMessage(CPartMessage& Message) {
PutStatusNotice(t_f("Removing channel {1}")(sChan));
m_pNetwork->DelChan(sChan);
} else {
if (pChan) pChan->SetIsOn(false);
sChans += (sChans.empty()) ? sChan : CString("," + sChan);
}
}
+23
View File
@@ -1316,5 +1316,28 @@ TEST_F(ZNCTest, JoinDetachedChannelMultiClient) {
client2.ReadUntil(":other!user@host QUIT :quit message");
}
// Commit ad7bd6d7eed84648638e1b6fd69546b9fe496576
// prevented rejoining when a client cycles a channel.
TEST_F(ZNCTest, ClientCycleChannels) {
auto znc = Run();
auto ircd = ConnectIRCd();
auto client = LoginClient();
ircd.Write(":server 001 nick :Hello");
client.Write("JOIN #test");
ircd.ReadUntil("JOIN #test");
ircd.Write(":nick JOIN :#test");
ircd.Write(":server 353 nick #test :nick");
ircd.Write(":server 366 nick #test :End of /NAMES list");
client.ReadUntil("End of /NAMES");
// Clients have '/hop' or '/cycle' command that sends
// 'PART #channel' and 'JOIN #channel'. Verify ZNC rejoins..
client.Write(":nick PART #test");
client.Write(":nick JOIN #test");
ircd.ReadUntil("JOIN #test");
}
} // namespace
} // namespace znc_inttest