From bbfec24e6b905909ab7b0be31625c9574c41785c Mon Sep 17 00:00:00 2001 From: RealKindOne Date: Sun, 23 Aug 2026 15:33:22 -0400 Subject: [PATCH] stichychan: Modernize and add test. --- modules/stickychan.cpp | 4 ++-- test/integration/tests/modules.cpp | 20 ++++++++++++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/modules/stickychan.cpp b/modules/stickychan.cpp index 499a2dfc..53122105 100644 --- a/modules/stickychan.cpp +++ b/modules/stickychan.cpp @@ -36,11 +36,11 @@ class CStickyChan : public CModule { bool OnLoad(const CString& sArgs, CString& sMessage) override; - EModRet OnUserPart(CString& sChannel, CString& sMessage) override { + EModRet OnUserPartMessage(CPartMessage& Message) override { if (!GetNetwork()) { return CONTINUE; } - + CString sChannel = Message.GetTarget(); for (MCString::iterator it = BeginNV(); it != EndNV(); ++it) { if (sChannel.Equals(it->first)) { CChan* pChan = GetNetwork()->FindChan(sChannel); diff --git a/test/integration/tests/modules.cpp b/test/integration/tests/modules.cpp index 573694be..9668b14c 100644 --- a/test/integration/tests/modules.cpp +++ b/test/integration/tests/modules.cpp @@ -956,6 +956,26 @@ TEST_F(ZNCTest, NickServModule) { ircd.ReadUntil("NICKSERV IDENTIFY hunter2"); } +TEST_F(ZNCTest, StickyChanModule) { + auto znc = Run(); + auto ircd = ConnectIRCd(); + auto client = LoginClient(); + + client.Write("znc loadmod stickychan"); + client.ReadUntil("Loaded module"); + + client.Write("PRIVMSG *stickychan :stick #sticky"); + client.ReadUntil("Stuck #stick"); + + ircd.Write("001 nick Welcome"); + ircd.Write(":nick JOIN :#sticky"); + + client.Write("PART #sticky :leaving"); + + client.Write("PRIVMSG *controlpanel :GetChan InConfig $me $network #sticky"); + client.ReadUntil("InConfig = true"); +} + } // namespace } // namespace znc_inttest