added gnutls backend and moved backend code into new files
[ircu2.10.12-pk.git] / ircd / hash.c
index 571a5023da922a46c581922a7f49f0a90081e14b..aa264ddb158500431bc94d4830e4d9b00e48a4bc 100644 (file)
@@ -30,6 +30,7 @@
 #include "ircd_reply.h"
 #include "ircd_string.h"
 #include "ircd.h"
+#include "match.h"
 #include "msg.h"
 #include "numeric.h"
 #include "random.h"
@@ -440,6 +441,10 @@ void list_next_channels(struct Client *cptr)
           && chptr->users < args->max_users
           && chptr->creationtime > args->min_time
           && chptr->creationtime < args->max_time
+          && (!args->wildcard[0] || (args->flags & LISTARG_NEGATEWILDCARD) ||
+              (!match(args->wildcard, chptr->chname)))
+          && (!(args->flags & LISTARG_NEGATEWILDCARD) ||
+              match(args->wildcard, chptr->chname))
           && (!(args->flags & LISTARG_TOPICLIMITS)
               || (chptr->topic[0]
                   && chptr->topic_time > args->min_topic_time
@@ -447,7 +452,17 @@ void list_next_channels(struct Client *cptr)
           && ((args->flags & LISTARG_SHOWSECRET)
               || ShowChannel(cptr, chptr)))
       {
-        send_reply(cptr, RPL_LIST, chptr->chname, chptr->users, chptr->topic);
+        if (args->flags & LISTARG_SHOWMODES) {
+          char modebuf[MODEBUFLEN];
+          char parabuf[MODEBUFLEN];
+
+          modebuf[0] = modebuf[1] = parabuf[0] = '\0';
+          channel_modes(cptr, modebuf, parabuf, sizeof(parabuf), chptr, NULL);
+          send_reply(cptr, RPL_LIST | SND_EXPLICIT, "%s %u %s %s :%s",
+                     chptr->chname, chptr->users, modebuf, parabuf, chptr->topic);
+        } else {
+          send_reply(cptr, RPL_LIST, chptr->chname, chptr->users, chptr->topic);
+        }
       }
     }
     /* If, at the end of the bucket, client sendq is more than half