Correctly handle mention keywords
authorKyle Fuller <redacted>
Thu, 14 Mar 2013 07:43:32 +0000 (07:43 +0000)
committerKyle Fuller <redacted>
Thu, 14 Mar 2013 10:45:12 +0000 (10:45 +0000)
palaver.cpp

index 97236973f8ab5245b51d37ee0449de74dac381d9..c41747fa09ecaa59a5f4d91eddabdf158fb58133 100644 (file)
@@ -256,12 +256,12 @@ public:
                                it != m_vMentionKeywords.end(); ++it) {
                        const CString& sKeyword = *it;
 
-                       if (sKeyword.Equals("{nick}") && sMessage.WildCmp("*" + sNick + "*")) {
+                       if (sKeyword.Equals("{nick}") && sMessage.find(sNick) != std::string::npos) {
                                bResult = true;
                                break;
                        }
 
-                       if (sMessage.WildCmp("*" + sKeyword + "*")) {
+                       if (sMessage.find(sKeyword) != std::string::npos) {
                                bResult = true;
                                break;
                        }
@@ -277,7 +277,7 @@ public:
                                it != m_vIgnoreKeywords.end(); ++it) {
                        const CString& sKeyword = *it;
 
-                       if (sMessage.WildCmp("*" + sKeyword + "*")) {
+                       if (sMessage.find(sKeyword) != std::string::npos) {
                                bResult = true;
                                break;
                        }
git clone https://git.99rst.org/PROJECT