]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_censor.cpp
Only send ACCOUNT and CHGHOST to clients that have sent NICK/USER.
[user/henk/code/inspircd.git] / src / modules / m_censor.cpp
index a9c55386c60c7d54a188cc3eeed560cba4a1cac2..a97cc8fcc2f2f85324e7a6135a9d861ce6a6436c 100644 (file)
@@ -104,7 +104,7 @@ class ModuleCensor : public Module
                 * reload our config file on rehash - we must destroy and re-allocate the classes
                 * to call the constructor again and re-read our data.
                 */
-               censors.clear();
+               censor_t newcensors;
 
                ConfigTagList badwords = ServerInstance->Config->ConfTags("badword");
                for (ConfigIter i = badwords.first; i != badwords.second; ++i)
@@ -112,16 +112,17 @@ class ModuleCensor : public Module
                        ConfigTag* tag = i->second;
                        const std::string text = tag->getString("text");
                        if (text.empty())
-                               continue;
+                               throw ModuleException("<badword:text> is empty! at " + tag->getTagLocation());
 
                        const std::string replace = tag->getString("replace");
-                       censors[text] = replace;
+                       newcensors[text] = replace;
                }
+               censors.swap(newcensors);
        }
 
        Version GetVersion() CXX11_OVERRIDE
        {
-               return Version("Provides user and channel +G mode",VF_VENDOR);
+               return Version("Provides user and channel mode +G", VF_VENDOR);
        }
 
 };