From 1fb23f184b779c3e2b7f5f68b5cc8911950693a3 Mon Sep 17 00:00:00 2001 From: michael Date: Wed, 4 Dec 2013 17:52:48 +0000 Subject: - Administrators may now see channel modes in /LIST git-svn-id: svn://svn.ircd-hybrid.org/svnroot/ircd-hybrid/branches/8.1.x@2617 82007160-df01-0410-b94d-b575c5fd34c7 --- src/hash.c | 17 ++++++++++++++++- src/numeric.c | 2 +- 2 files changed, 17 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/hash.c b/src/hash.c index a7fc19e..8425db5 100644 --- a/src/hash.c +++ b/src/hash.c @@ -762,6 +762,10 @@ static void list_one_channel(struct Client *source_p, struct Channel *chptr, struct ListTask *list_task) { + char listbuf[MODEBUFLEN] = ""; + char modebuf[MODEBUFLEN] = ""; + char parabuf[MODEBUFLEN] = ""; + if (SecretChannel(chptr) && !(IsMember(source_p, chptr) || HasUMode(source_p, UMODE_ADMIN))) return; @@ -777,8 +781,19 @@ list_one_channel(struct Client *source_p, struct Channel *chptr, if (!list_allow_channel(chptr->chname, list_task)) return; + + if (HasUMode(source_p, UMODE_ADMIN)) + { + channel_modes(chptr, source_p, modebuf, parabuf); + + if (chptr->topic[0]) + snprintf(listbuf, sizeof(listbuf), "[%s] ", modebuf); + else + snprintf(listbuf, sizeof(listbuf), "[%s]", modebuf); + } + sendto_one(source_p, form_str(RPL_LIST), me.name, source_p->name, - chptr->chname, dlink_list_length(&chptr->members), + chptr->chname, dlink_list_length(&chptr->members), listbuf, chptr->topic); } diff --git a/src/numeric.c b/src/numeric.c index f5240a8..67cffa0 100644 --- a/src/numeric.c +++ b/src/numeric.c @@ -353,7 +353,7 @@ static const char *const replies[] = { /* 319 RPL_WHOISCHANNELS */ ":%s 319 %s %s :%s", /* 320 */ NULL, /* 321 RPL_LISTSTART */ ":%s 321 %s Channel :Users Name", -/* 322 RPL_LIST */ ":%s 322 %s %s %d :%s", +/* 322 RPL_LIST */ ":%s 322 %s %s %d :%s%s", /* 323 RPL_LISTEND */ ":%s 323 %s :End of /LIST", /* 324 RPL_CHANNELMODEIS */ ":%s 324 %s %s %s %s", /* 325 */ NULL, -- cgit