#include "s_bsd.h"
#include "send.h"
-#include <assert.h>
+/* #include <assert.h> -- Now using assert in ircd_log.h */
#include <stdlib.h>
#include <string.h>
send_reply(sptr, RPL_LISTUSAGE,
"Usage: \002/QUOTE LIST\002 \037parameters\037");
send_reply(sptr, RPL_LISTUSAGE,
- "Where \037parameters\037 is a space or comma seperated "
+ "Where \037parameters\037 is a space or comma separated "
"list of one or more of:");
send_reply(sptr, RPL_LISTUSAGE,
" \002<\002\037max_users\037 ; Show all channels with less "
case 'S':
case 's':
- if (!IsAnOper(sptr))
+ if (!IsAnOper(sptr) || !HasPriv(sptr, PRIV_LIST_CHAN))
return show_usage(sptr);
args->flags |= LISTARG_SHOWSECRET;
param++;
- if (*param != ',' && *param != ' ' && *param !+ '\0') /* check syntax */
+ if (*param != ',' && *param != ' ' && *param != '\0') /* check syntax */
return show_usage(sptr);
break;
if (cli_listing(sptr)) /* Already listing ? */
{
- cli_listing(sptr)->chptr->mode.mode &= ~MODE_LISTED;
MyFree(cli_listing(sptr));
cli_listing(sptr) = 0;
send_reply(sptr, RPL_LISTEND);
cli_listing(sptr) = (struct ListingArgs*) MyMalloc(sizeof(struct ListingArgs));
assert(0 != cli_listing(sptr));
memcpy(cli_listing(sptr), &args, sizeof(struct ListingArgs));
- if ((cli_listing(sptr)->chptr = GlobalChannelList)) {
- int m = GlobalChannelList->mode.mode & MODE_LISTED;
- list_next_channels(sptr, 64);
- GlobalChannelList->mode.mode |= m;
- return 0;
- }
- MyFree(cli_listing(sptr));
- cli_listing(sptr) = 0;
+ list_next_channels(sptr);
+ return 0;
}
send_reply(sptr, RPL_LISTEND);
return 0;
for (; (name = ircd_strtok(&p, parv[1], ",")); parv[1] = 0)
{
chptr = FindChannel(name);
- if (chptr && ShowChannel(sptr, chptr) && cli_user(sptr))
+ if (!chptr)
+ continue;
+ if (ShowChannel(sptr, chptr)
+ || (IsAnOper(sptr) && HasPriv(sptr, PRIV_LIST_CHAN)))
send_reply(sptr, RPL_LIST, chptr->chname,
chptr->users - number_of_zombies(chptr), chptr->topic);
}