]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_joinflood.cpp
Fix REMOVE maxparams
[user/henk/code/inspircd.git] / src / modules / m_joinflood.cpp
index 853ddee755dcfd86ae0c1a34c9e355def75e69ab..c53a6d1c455268a31b05eb5569ba88290f7d4cec 100644 (file)
@@ -87,7 +87,7 @@ class JoinFlood : public ModeHandler
 {
  public:
        SimpleExtItem<joinfloodsettings> ext;
-       JoinFlood(InspIRCd* Instance, Module* Creator) : ModeHandler(Instance, Creator, 'j', 1, 0, false, MODETYPE_CHANNEL, false),
+       JoinFlood(InspIRCd* Instance, Module* Creator) : ModeHandler(Creator, 'j', PARAM_SETONLY, MODETYPE_CHANNEL),
                ext("joinflood", Creator) { }
 
        ModePair ModeSet(User* source, User* dest, Channel* channel, const std::string &parameter)
@@ -221,13 +221,13 @@ class ModuleJoinFlood : public Module
                return MOD_RES_PASSTHRU;
        }
 
-       void OnUserJoin(User* user, Channel* channel, bool sync, bool &silent, bool created)
+       void OnUserJoin(Membership* memb, bool sync, bool created, CUList& excepts)
        {
                /* We arent interested in JOIN events caused by a network burst */
                if (sync)
                        return;
 
-               joinfloodsettings *f = jf.ext.get(channel);
+               joinfloodsettings *f = jf.ext.get(memb->chan);
 
                /* But all others are OK */
                if (f)
@@ -237,7 +237,7 @@ class ModuleJoinFlood : public Module
                        {
                                f->clear();
                                f->lock();
-                               channel->WriteChannelWithServ((char*)ServerInstance->Config->ServerName, "NOTICE %s :This channel has been closed to new users for 60 seconds because there have been more than %d joins in %d seconds.", channel->name.c_str(), f->joins, f->secs);
+                               memb->chan->WriteChannelWithServ((char*)ServerInstance->Config->ServerName, "NOTICE %s :This channel has been closed to new users for 60 seconds because there have been more than %d joins in %d seconds.", memb->chan->name.c_str(), f->joins, f->secs);
                        }
                }
        }