From 34aece328ec02f9d305c5e5f8afa0b4e70d687e9 Mon Sep 17 00:00:00 2001 From: Chris Tyrrel <6564270+ChrisTyrrel@users.noreply.github.com> Date: Sun, 23 Jan 2022 10:11:25 -0700 Subject: [PATCH 1/2] Allow spaces when adding new pattern --- modules/watch.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/watch.cpp b/modules/watch.cpp index 404ee75e..e975f04a 100644 --- a/modules/watch.cpp +++ b/modules/watch.cpp @@ -632,7 +632,7 @@ class CWatcherMod : public CModule { CString sHostMask = sLine.Token(1); CString sTarget = sLine.Token(2); - CString sPattern = sLine.Token(3); + CString sPattern = sLine.Token(3, true); CString sMessage; From c87192fb05ab4827ced3bbcfd5891b7fdb36c286 Mon Sep 17 00:00:00 2001 From: Chris Tyrrel <6564270+ChrisTyrrel@users.noreply.github.com> Date: Sun, 23 Jan 2022 10:52:01 -0700 Subject: [PATCH 2/2] Add test for watch with spaces --- test/integration/tests/modules.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/integration/tests/modules.cpp b/test/integration/tests/modules.cpp index f283ceb7..1a35c44f 100644 --- a/test/integration/tests/modules.cpp +++ b/test/integration/tests/modules.cpp @@ -78,6 +78,11 @@ TEST_F(ZNCTest, WatchModule) { ircd.Write(":n!i@h PRIVMSG #znc :\001ACTION foo\001"); client.ReadUntil( ":$*!watch@znc.in PRIVMSG nick :* CTCP: n [ACTION foo] to [#znc]"); + client.Write("PRIVMSG *watch :add * *spaces *word1 word2*"); + client.ReadUntil("Adding entry:"); + ircd.Write(":n!i@h PRIVMSG #znc :SOMETHING word1 word2 SOMETHING"); + client.ReadUntil( + ":*spaces!watch@znc.in PRIVMSG nick : SOMETHING word1 word2 SOMETHING"); } TEST_F(ZNCTest, ModuleCrypt) {