]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_delaymsg.cpp
Fix iteration of ServerInstance->Users->local_users now that QuitUser can modify...
[user/henk/code/inspircd.git] / src / modules / m_delaymsg.cpp
index 5e2bb838cce057f7d5032a9e86c25877b121195a..1673d05baf700021ae05035f4ba60fb2790f37c6 100644 (file)
@@ -22,7 +22,11 @@ class DelayMsgMode : public ModeHandler
        CUList empty;
  public:
        LocalIntExt jointime;
-       DelayMsgMode(InspIRCd* Instance, Module* Parent) : ModeHandler(Instance, Parent, 'd', 1, 0, false, MODETYPE_CHANNEL, false, 0, '@'), jointime("delaymsg", Parent) {};
+       DelayMsgMode(InspIRCd* Instance, Module* Parent) : ModeHandler(Parent, 'd', PARAM_SETONLY, MODETYPE_CHANNEL)
+               , jointime("delaymsg", Parent)
+       {
+               levelrequired = OP_VALUE;
+       }
 
        ModePair ModeSet(User*, User*, Channel* channel, const std::string &parameter)
        {
@@ -60,10 +64,7 @@ class ModuleDelayMsg : public Module
        }
        ~ModuleDelayMsg();
        Version GetVersion();
-       void OnUserJoin(User* user, Channel* channel, bool sync, bool &silent, bool created);
-       void OnUserPart(User* user, Channel* channel, std::string &partmessage, bool &silent);
-       void OnUserKick(User* source, User* user, Channel* chan, const std::string &reason, bool &silent);
-       void OnCleanup(int target_type, void* item);
+       void OnUserJoin(Membership* memb, bool sync, bool created, CUList&);
        ModResult OnUserPreMessage(User* user, void* dest, int target_type, std::string &text, char status, CUList &exempt_list);
 };
 
@@ -103,11 +104,10 @@ Version ModuleDelayMsg::GetVersion()
        return Version("$Id$", VF_COMMON | VF_VENDOR, API_VERSION);
 }
 
-void ModuleDelayMsg::OnUserJoin(User* user, Channel* channel, bool sync, bool &silent, bool created)
+void ModuleDelayMsg::OnUserJoin(Membership* memb, bool sync, bool created, CUList&)
 {
-       if (channel->IsModeSet('d'))
+       if (memb->chan->IsModeSet('d'))
        {
-               Membership* memb = channel->GetUser(user);
                djm.jointime.set(memb, ServerInstance->Time());
        }
 }