+2007-11-04 Michael Poole <mdpoole@troilus.org>
+
+ * doc/example.conf: Document /LIST M as controlled by list_chan.
+
+ * include/channel.h (LISTARG_SHOWMODES): Define.
+
+ * ircd/hash.c (list_next_channels): Handle it.
+
+ * ircd/m_list.c (show_usage): Document 'M' flag.
+ (param_parse): Recognize 'M' as LISTARGS_SHOWMODES.
+
2007-11-04 Michael Poole <mdpoole@troilus.org>
* ircd/m_list.c (param_parse): Reverse comparison direction when
# local_gline (can set a G-line for this server only)
# local_badchan (can set a Gchan for this server only)
# see_chan (can see users in +s channels in /WHO)
- # list_chan (can see +s channels with /LIST S)
+ # list_chan (can see +s channels with /LIST S, or modes with /LIST M)
# wide_gline (can use ! to force a wide G-line)
# see_opers (can see opers without DISPLAY privilege)
# local_opmode (can use OPMODE/CLEARMODE on local channels)
#define LISTARG_TOPICLIMITS 0x0001
#define LISTARG_SHOWSECRET 0x0002
#define LISTARG_NEGATEWILDCARD 0x0004
+#define LISTARG_SHOWMODES 0x0008
/**
* Maximum acceptable lag time in seconds: A channel younger than
&& ((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
"matching \037pattern\037. ");
send_reply(sptr, RPL_LISTUSAGE, "Note: Patterns may contain * and ?. "
"You may only give one pattern match constraint.");
- if (IsAnOper(sptr))
+ if (IsAnOper(sptr)) {
send_reply(sptr, RPL_LISTUSAGE,
" \002S\002 ; Show secret channels.");
+ send_reply(sptr, RPL_LISTUSAGE,
+ " \002M\002 ; Show channel modes.");
+ }
send_reply(sptr, RPL_LISTUSAGE,
"Example: LIST <3,>1,C<10,T>0,#a* ; 2 users, younger than 10 "
"min., topic set., starts with #a");
return show_usage(sptr);
break;
+ case 'M':
+ case 'm':
+ if (!IsAnOper(sptr) || !HasPriv(sptr, PRIV_LIST_CHAN))
+ return show_usage(sptr);
+
+ args->flags |= LISTARG_SHOWMODES;
+ param++;
+
+ if (*param != ',' && *param != ' ' && *param != '\0') /* check syntax */
+ return show_usage(sptr);
+ break;
+
default:
/* It might be a wildcard... */
if (strchr(param, '*') ||