]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_delaymsg.cpp
Add a Flash Policy Daemon module
[user/henk/code/inspircd.git] / src / modules / m_delaymsg.cpp
index 15e997301aab76741a9c7079ff2bca17813f982d..031680e189cacb5d3ed6b673f99ba9b4bd0963ad 100644 (file)
@@ -19,8 +19,6 @@
 
 #include "inspircd.h"
 
-/* $ModDesc: Provides channelmode +d <int>, to deny messages to a channel until <int> seconds. */
-
 class DelayMsgMode : public ModeHandler
 {
  public:
@@ -47,13 +45,6 @@ class ModuleDelayMsg : public Module
        {
        }
 
-       void init() CXX11_OVERRIDE
-       {
-               ServerInstance->Modules->AddService(djm);
-               ServerInstance->Modules->AddService(djm.jointime);
-               Implementation eventlist[] = { I_OnUserJoin, I_OnUserPreMessage};
-               ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation));
-       }
        Version GetVersion() CXX11_OVERRIDE;
        void OnUserJoin(Membership* memb, bool sync, bool created, CUList&) CXX11_OVERRIDE;
        ModResult OnUserPreMessage(User* user, void* dest, int target_type, std::string& text, char status, CUList& exempt_list, MessageType msgtype) CXX11_OVERRIDE;
@@ -129,8 +120,8 @@ ModResult ModuleDelayMsg::OnUserPreMessage(User* user, void* dest, int target_ty
        {
                if (channel->GetPrefixValue(user) < VOICE_VALUE)
                {
-                       user->WriteNumeric(404, "%s %s :You must wait %s seconds after joining to send to channel (+d)",
-                               user->nick.c_str(), channel->name.c_str(), len.c_str());
+                       user->WriteNumeric(ERR_CANNOTSENDTOCHAN, "%s :You must wait %s seconds after joining to send to channel (+d)",
+                               channel->name.c_str(), len.c_str());
                        return MOD_RES_DENY;
                }
        }