]> jfr.im git - irc/evilnet/x3.git/blobdiff - src/chanserv.c
fixing small memory leak
[irc/evilnet/x3.git] / src / chanserv.c
index 07a1bc40dc656dd500eda24171fe76e221be7830..3b0986cdea7cadd36d1e66ff9d72ca375f13044a 100644 (file)
@@ -236,7 +236,7 @@ static const struct message_entry msgtab[] = {
     { "CSMSG_BAN_DONE", "Banned $b%s$b from %s." },
     { "CSMSG_REASON_CHANGE", "Reason for LAMER $b%s$b changed." },
     { "CSMSG_LAMER_EXTENDED", "Extended LAMER for $b%s$b, now expires in %s." },
-    { "CSMSG_BAN_REMOVED", "Matching ban(s) and LAMER(s) in $b%s$b were removed." },
+    { "CSMSG_BAN_REMOVED", "Ban(s) and LAMER(s) matching $b%s$b were removed." },
     { "CSMSG_TRIMMED_LAMERS", "Trimmed $b%d LAMERs$b from the %s LAMER list that were inactive for at least %s." },
     { "CSMSG_REDUNDANT_BAN", "$b%s$b is already banned in %s." },
     { "CSMSG_REDUNDANT_LAMER", "$b%s$b is already LAMER'd in %s." },
@@ -7264,35 +7264,22 @@ handle_new_channel(struct chanNode *channel)
 int
 trace_check_bans(struct userNode *user, struct chanNode *chan)
 {
-    struct chanData *cData;
     struct banData *bData;
     struct mod_chanmode *change;
 
-    if(!(cData = chan->channel_info))
-        return 0;
-
     change = find_matching_bans(&chan->banlist, user, NULL);
     if (change)
        return 1;
 
-    /* ircd list
-    if (chan->banlist.used) {
-        unsigned int i;
-        for (i=0; i<chan->banlist.used; i++) {
-           if (!user_matches_glob(user, chan->banlist.list[i], MATCH_USENICK))
-               return 1;
-        }
-    }
-*/
     /* lamer list */
-    if(chan->banlist.used < MAXBANS)
-    {
-        for(bData = cData->bans;
-            bData && !user_matches_glob(user, bData->mask, MATCH_USENICK);
-            bData = bData->next);
+    if (chan->channel_info) {
+        for(bData = chan->channel_info->bans; bData; bData = bData->next) {
 
-        if(bData) {
-            return 1;
+            if(!user_matches_glob(user, bData->mask, MATCH_USENICK))
+                continue;
+
+            if(bData)
+               return 1;
         }
     }