Save channel key on user JOIN even if user was not on the channel yet,

which is the usual case.

Fix #1223
This commit is contained in:
Alexey Sokolov
2018-02-14 08:30:21 +00:00
parent 986bb8dc6d
commit 5cb50eccd1
2 changed files with 34 additions and 7 deletions
+20
View File
@@ -262,5 +262,25 @@ TEST_F(ZNCTest, AwayNotify) {
client.ReadUntil("DEL :away-notify");
}
TEST_F(ZNCTest, JoinKey) {
QFile conf(m_dir.path() + "/configs/znc.conf");
ASSERT_TRUE(conf.open(QIODevice::Append | QIODevice::Text));
QTextStream(&conf) << "ServerThrottle = 1\n";
auto znc = Run();
auto ircd = ConnectIRCd();
auto client = LoginClient();
ircd.Write(":server 001 nick :Hello");
client.Write("JOIN #znc secret");
ircd.ReadUntil("JOIN #znc secret");
ircd.Write(":nick JOIN :#znc");
client.ReadUntil("JOIN :#znc");
ircd.Close();
ircd = ConnectIRCd();
ircd.Write(":server 001 nick :Hello");
ircd.ReadUntil("JOIN #znc secret");
}
} // namespace
} // namespace znc_inttest