]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/u_listmode.h
Fix mistakenly using Clang instead of GCC on older FreeBSD versions.
[user/henk/code/inspircd.git] / src / modules / u_listmode.h
index 3d82a0c81bb0c22e3682121b6c443b52344d88da..a728eb8397e3c1a21552731bd585a762c79794b8 100644 (file)
@@ -201,13 +201,13 @@ class ListModeBase : public ModeHandler
                        if (limit.mask.size() && limit.limit > 0)
                                chanlimits.push_back(limit);
                }
-               if (chanlimits.size() == 0)
-               {
-                       ListLimit limit;
-                       limit.mask = "*";
-                       limit.limit = 64;
-                       chanlimits.push_back(limit);
-               }
+
+               // Add the default entry. This is inserted last so if the user specifies a
+               // wildcard record in the config it will take precedence over this entry.
+               ListLimit limit;
+               limit.mask = "*";
+               limit.limit = 64;
+               chanlimits.push_back(limit);
        }
 
        /** Populate the Implements list with the correct events for a List Mode
@@ -217,7 +217,7 @@ class ListModeBase : public ModeHandler
                ServerInstance->Modules->AddService(extItem);
                this->DoRehash();
                Implementation eventlist[] = { I_OnSyncChannel, I_OnRehash };
-               ServerInstance->Modules->Attach(eventlist, m, 2);
+               ServerInstance->Modules->Attach(eventlist, m, sizeof(eventlist)/sizeof(Implementation));
        }
 
        /** Handle the list mode.
@@ -294,6 +294,8 @@ class ListModeBase : public ModeHandler
                                                        return MODEACTION_DENY;
                                                }
                                        }
+                                       else
+                                               break;
                                }
                        }
 
@@ -316,7 +318,7 @@ class ListModeBase : public ModeHandler
                                        if (parameter == it->mask)
                                        {
                                                el->erase(it);
-                                               if (el->size() == 0)
+                                               if (el->empty())
                                                {
                                                        extItem.unset(channel);
                                                }