]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/u_listmode.h
Fix TBAN not working if the banner is owner/protected
[user/henk/code/inspircd.git] / src / modules / u_listmode.h
index 981e2a369bbc411b5312d6f373038d9eb32c5ce6..7e018e55845fc5e425da2a0cceada1d8fb43e752 100644 (file)
@@ -2,7 +2,7 @@
  *       | Inspire Internet Relay Chat Daemon |
  *       +------------------------------------+
  *
- *  InspIRCd: (C) 2002-2009 InspIRCd Development Team
+ *  InspIRCd: (C) 2002-2010 InspIRCd Development Team
  * See: http://wiki.inspircd.org/Credits
  *
  * This program is free but copyrighted software; see
@@ -25,7 +25,7 @@ inline std::string stringtime()
 
 /** An item in a listmode's list
  */
-class ListItem : public classbase
+class ListItem
 {
 public:
        std::string nick;
@@ -35,7 +35,7 @@ public:
 
 /** The number of items a listmode's list may contain
  */
-class ListLimit : public classbase
+class ListLimit
 {
 public:
        std::string mask;
@@ -95,7 +95,7 @@ class ListModeBase : public ModeHandler
        {
                list = true;
                this->DoRehash();
-               Extensible::Register(&extItem);
+               ServerInstance->Extensions.Register(&extItem);
        }
 
        /** See mode.h
@@ -182,16 +182,17 @@ class ListModeBase : public ModeHandler
         */
        virtual void DoRehash()
        {
-               ConfigReader Conf;
+               ConfigTagList tags = ServerInstance->Config->ConfTags(configtag);
 
                chanlimits.clear();
 
-               for (int i = 0; i < Conf.Enumerate(configtag); i++)
+               for (ConfigIter i = tags.first; i != tags.second; i++)
                {
                        // For each <banlist> tag
+                       ConfigTag* c = i->second;
                        ListLimit limit;
-                       limit.mask = Conf.ReadValue(configtag, "chan", i);
-                       limit.limit = Conf.ReadInteger(configtag, "limit", i, true);
+                       limit.mask = c->getString("chan");
+                       limit.limit = c->getInt("limit");
 
                        if (limit.mask.size() && limit.limit > 0)
                                chanlimits.push_back(limit);
@@ -209,8 +210,8 @@ class ListModeBase : public ModeHandler
         */
        virtual void DoImplements(Module* m)
        {
-               Implementation eventlist[] = { I_OnChannelDelete, I_OnSyncChannel, I_OnRehash };
-               ServerInstance->Modules->Attach(eventlist, m, 3);
+               Implementation eventlist[] = { I_OnSyncChannel, I_OnRehash };
+               ServerInstance->Modules->Attach(eventlist, m, 2);
        }
 
        /** Handle the list mode.