mirror of
https://github.com/znc/znc.git
synced 2026-07-06 18:01:21 +02:00
Don't forward client JOINs during registration
ZNC remembers that it should join these channels, and will join them after registration. But if client automatically joins some channels, we don't want it to be added to send queue before parts of registration itself (CAP, AUTHENTICATE), because server will just disconnect with "Registration timeout". After registration is complete, using /join still joins the channel immediately. Only limiting this to joins, because server may request some input from user to finish registration, and joins are the ones which are prone to be sent automatically by client to cause issues. Fix #1949
This commit is contained in:
@@ -1172,5 +1172,19 @@ TEST_F(ZNCTest, ManyCapsInReq) {
|
||||
EXPECT_TRUE(caps.split(' ').contains(caps3));
|
||||
}
|
||||
|
||||
TEST_F(ZNCTest, JoinWhileRegistration) {
|
||||
auto znc = Run();
|
||||
auto ircd = ConnectIRCd();
|
||||
auto client = LoginClient();
|
||||
// First JOIN just adds channel to the list, second one updates the key and
|
||||
// sends JOIN from CChan::JoinUser. Both should be delayed until
|
||||
// registration ends.
|
||||
client.Write("JOIN #foo");
|
||||
client.Write("JOIN #foo");
|
||||
EXPECT_THAT(ircd.ReadRemainder().toStdString(), Not(HasSubstr("JOIN")));
|
||||
ircd.Write(":server 001 nick :Hello");
|
||||
ircd.ReadUntil("JOIN #foo");
|
||||
}
|
||||
|
||||
} // namespace
|
||||
} // namespace znc_inttest
|
||||
|
||||
Reference in New Issue
Block a user