diff --git a/test/integration/tests/core.cpp b/test/integration/tests/core.cpp index c60707a9..202fa21b 100644 --- a/test/integration/tests/core.cpp +++ b/test/integration/tests/core.cpp @@ -1048,15 +1048,38 @@ TEST_F(ZNCTest, InviteNotify) { client.ReadUntil("ACK"); auto client2 = LoginClient(); + InstallModule("testmod.cpp", R"( + #include + class TestModule : public CModule { + public: + MODCONSTRUCTOR(TestModule) {} + EModRet OnInviteMessage(CInviteMessage& Msg) override { + PutIRC("__MSG__ " + Msg.ToString()); + return CONTINUE; + } + EModRet OnInvite(const CNick& Nick, const CString& sChan) override { + PutIRC("__INV__ " + Nick.GetNickMask() + " " + sChan); + return CONTINUE; + } + }; + GLOBALMODULEDEFS(TestModule, "Test") + )"); + client.Write("znc loadmod testmod"); + client.ReadUntil("Loaded module testmod"); + ircd.Write("001 nick Welcome"); ircd.Write(":source!id@ho INVITE nick #chan"); client.ReadUntil(":source!id@ho INVITE nick #chan"); client2.ReadUntil(":source!id@ho INVITE nick #chan"); + ircd.ReadUntil("__MSG__ :source!id@ho INVITE nick #chan"); + ircd.ReadUntil("__INV__ source!id@ho #chan"); ircd.Write(":source!id@ho INVITE someone #chan"); client.ReadUntil(":source!id@ho INVITE someone #chan"); ASSERT_THAT(client2.ReadRemainder().toStdString(), Not(HasSubstr("someone"))); + ircd.ReadUntil("__MSG__ :source!id@ho INVITE someone #chan"); + ASSERT_THAT(ircd.ReadRemainder().toStdString(), Not(HasSubstr("__INV__"))); } } // namespace