]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_censor.cpp
m_spanningtree Allow multiple valid ips for link blocks as a result of SecurityIPResolver
[user/henk/code/inspircd.git] / src / modules / m_censor.cpp
index 209d61d4a0ac2ecdf4fb419c7dc0216099b35432..d2a60275a8705ee43c101ee90fc9644a70e045cd 100644 (file)
@@ -22,7 +22,7 @@
 
 #include "inspircd.h"
 
-typedef std::map<irc::string,irc::string> censor_t;
+typedef insp::flat_map<irc::string, irc::string> censor_t;
 
 /** Handles usermode +G
  */
@@ -79,11 +79,11 @@ class ModuleCensor : public Module
                        {
                                if (index->second.empty())
                                {
-                                       user->WriteNumeric(ERR_WORDFILTERED, "%s %s :Your message contained a censored word, and was blocked", ((Channel*)dest)->name.c_str(), index->first.c_str());
+                                       user->WriteNumeric(ERR_WORDFILTERED, ((target_type == TYPE_CHANNEL) ? ((Channel*)dest)->name : ((User*)dest)->nick), index->first.c_str(), "Your message contained a censored word, and was blocked");
                                        return MOD_RES_DENY;
                                }
 
-                               SearchAndReplace(text2, index->first, index->second);
+                               stdalgo::string::replace_all(text2, index->first, index->second);
                        }
                }
                text = text2.c_str();