]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_delaymsg.cpp
Merge pull request #1443 from B00mX0r/master+filtershun
[user/henk/code/inspircd.git] / src / modules / m_delaymsg.cpp
index 32a0ba96ee03d9bdba01e44167fae735482d3fe6..247630e65e4a6e2d19186ace07144ad19ea155f9 100644 (file)
@@ -25,17 +25,17 @@ class DelayMsgMode : public ParamMode<DelayMsgMode, LocalIntExt>
        LocalIntExt jointime;
        DelayMsgMode(Module* Parent)
                : ParamMode<DelayMsgMode, LocalIntExt>(Parent, "delaymsg", 'd')
-               , jointime("delaymsg", Parent)
+               , jointime("delaymsg", ExtensionItem::EXT_MEMBERSHIP, Parent)
        {
-               levelrequired = OP_VALUE;
+               ranktoset = ranktounset = OP_VALUE;
        }
 
-       bool ResolveModeConflict(std::string &their_param, const std::string &our_param, Channel*)
+       bool ResolveModeConflict(std::string& their_param, const std::string& our_param, Channel*) CXX11_OVERRIDE
        {
                return (atoi(their_param.c_str()) < atoi(our_param.c_str()));
        }
 
-       ModeAction OnSet(User* source, Channel* chan, std::string& parameter);
+       ModeAction OnSet(User* source, Channel* chan, std::string& parameter) CXX11_OVERRIDE;
        void OnUnset(User* source, Channel* chan);
 
        void SerializeParam(Channel* chan, int n, std::string& out)
@@ -118,8 +118,7 @@ ModResult ModuleDelayMsg::OnUserPreMessage(User* user, void* dest, int target_ty
        {
                if (channel->GetPrefixValue(user) < VOICE_VALUE)
                {
-                       user->WriteNumeric(ERR_CANNOTSENDTOCHAN, "%s :You must wait %d seconds after joining to send to channel (+d)",
-                               channel->name.c_str(), len);
+                       user->WriteNumeric(ERR_CANNOTSENDTOCHAN, channel->name, InspIRCd::Format("You must wait %d seconds after joining to send to channel (+d)", len));
                        return MOD_RES_DENY;
                }
        }