diff --git a/modules/corecaps.cpp b/modules/corecaps.cpp index 135c1998..cd412a3b 100644 --- a/modules/corecaps.cpp +++ b/modules/corecaps.cpp @@ -70,6 +70,11 @@ class CCoreCaps : public CModule { } }; +template <> +void TModInfo(CModInfo& Info) { + Info.SetWikiPage("corecaps"); +} + GLOBALMODULEDEFS( CCoreCaps, t_s("Adds support for several IRC capabilities, extracted from ZNC core.")) diff --git a/src/Client.cpp b/src/Client.cpp index c5d7c5a7..acb7e8b6 100644 --- a/src/Client.cpp +++ b/src/Client.cpp @@ -375,7 +375,7 @@ void CClient::AuthUser() { } } -/** Username+password auth, which reports success/failure to client via SASL. */ +/** Username+password auth, which reports success/failure to client via SASL. */ class CClientSASLAuth : public CClientAuth { public: using CClientAuth::CClientAuth; @@ -1463,7 +1463,7 @@ bool CClient::OnJoinMessage(CJoinMessage& Message) { else pChan->JoinUser(sKey); continue; - } else if (!sChannel.empty()) { + } else if (!sChannel.empty() && m_pNetwork->IsChan(sChannel)) { pChan = new CChan(sChannel, m_pNetwork, false); if (m_pNetwork->AddChan(pChan)) { pChan->SetKey(sKey); diff --git a/test/integration/tests/core.cpp b/test/integration/tests/core.cpp index 876cdd7e..3937205c 100644 --- a/test/integration/tests/core.cpp +++ b/test/integration/tests/core.cpp @@ -1463,5 +1463,28 @@ TEST_F(ZNCTest, MotdBufferDoesNotAccumulate376) { Not(HasSubstr("End of /MOTD command"))); } +// https://github.com/znc/znc/issues/1794 +TEST_F(ZNCTest, PrependJoinBug) { + auto znc = Run(); + auto ircd = ConnectIRCd(); + auto client = LoginClient(); + + ircd.Write(":server 001 nick :Hello"); + ircd.Write(":server 005 nick CHANTYPES=# :supports"); + client.ReadUntil("005"); + + client.Write("JOIN 0"); + ircd.ReadUntil("JOIN 0"); + + client.Write("znc listchans"); + ASSERT_THAT(client.ReadRemainder().toStdString(), Not(HasSubstr("#0"))); + + client.Write("JOIN test"); + ircd.ReadUntil("JOIN test"); + + client.Write("znc listchans"); + ASSERT_THAT(client.ReadRemainder().toStdString(), Not(HasSubstr("#test"))); +} + } // namespace } // namespace znc_inttest