]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_deaf.cpp
Move the <disabled> tag out of the core to a new module.
[user/henk/code/inspircd.git] / src / modules / m_deaf.cpp
index 88919e91b072540184fe3637360109fd95537bf1..e58d130a52417b429cc46bdf3e87d4befed33de3 100644 (file)
@@ -28,7 +28,7 @@ class User_d : public ModeHandler
  public:
        User_d(Module* Creator) : ModeHandler(Creator, "deaf", 'd', PARAM_NONE, MODETYPE_USER) { }
 
-       ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding)
+       ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string& parameter, bool adding) CXX11_OVERRIDE
        {
                if (adding == dest->IsModeSet(this))
                        return MODEACTION_DENY;
@@ -60,14 +60,14 @@ class ModuleDeaf : public Module
                deaf_bypasschars_uline = tag->getString("bypasscharsuline");
        }
 
-       ModResult OnUserPreMessage(User* user, void* dest, int target_type, std::string& text, char status, CUList& exempt_list, MessageType msgtype) CXX11_OVERRIDE
+       ModResult OnUserPreMessage(User* user, const MessageTarget& target, MessageDetails& details) CXX11_OVERRIDE
        {
-               if (target_type != TYPE_CHANNEL)
+               if (target.type != MessageTarget::TYPE_CHANNEL)
                        return MOD_RES_PASSTHRU;
 
-               Channel* chan = static_cast<Channel*>(dest);
-               bool is_bypasschar = (deaf_bypasschars.find(text[0]) != std::string::npos);
-               bool is_bypasschar_uline = (deaf_bypasschars_uline.find(text[0]) != std::string::npos);
+               Channel* chan = target.Get<Channel>();
+               bool is_bypasschar = (deaf_bypasschars.find(details.text[0]) != std::string::npos);
+               bool is_bypasschar_uline = (deaf_bypasschars_uline.find(details.text[0]) != std::string::npos);
 
                /*
                 * If we have no bypasschars_uline in config, and this is a bypasschar (regular)
@@ -95,7 +95,7 @@ class ModuleDeaf : public Module
                                continue; /* deliver message */
 
                        /* don't deliver message! */
-                       exempt_list.insert(i->first);
+                       details.exemptions.insert(i->first);
                }
 
                return MOD_RES_PASSTHRU;