Allow nick matching if nick contains a word boundary
authorKyle Fuller <redacted>
Wed, 30 Sep 2015 23:10:49 +0000 (16:10 -0700)
committerKyle Fuller <redacted>
Wed, 30 Sep 2015 23:10:49 +0000 (16:10 -0700)
Fixes #30

palaver.cpp

index ebc829588417cee96960ab595cd1f0d113020973..a5784725fa9ca693f07424e9f75b24abca2a10b2 100644 (file)
@@ -494,6 +494,14 @@ public:
                                bResult = true;
                                break;
                        }
+
+                       // If that didn't match, and the keyword contains a word boundary
+                       if (!bResult && (sKeyword.find("[") != std::string::npos || sKeyword.find("]") != std::string::npos)) {
+                               if (sMessage.find(sKeyword) != std::string::npos) {
+                                       bResult = true;
+                                       break;
+                               }
+                       }
 #else
                        if (sMessage.find(sKeyword) != std::string::npos) {
                                bResult = true;
git clone https://git.99rst.org/PROJECT