Merge branch 'master' into unix

This commit is contained in:
Alexey Sokolov
2025-05-01 22:41:27 +01:00
48 changed files with 2044 additions and 1938 deletions

View File

@@ -1062,5 +1062,47 @@ TEST_F(ZNCTest, StatusAction) {
ASSERT_THAT(ircd.ReadRemainder().toStdString(), Not(HasSubstr("PRIVMSG")));
}
TEST_F(ZNCTest, InviteNotify) {
auto znc = Run();
auto ircd = ConnectIRCd();
auto client = LoginClient();
client.Write("CAP REQ invite-notify");
client.ReadUntil("ACK");
auto client2 = LoginClient();
InstallModule("testmod.cpp", R"(
#include <znc/Modules.h>
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
} // namespace znc_inttest