From 79a0619fa0428943d74c5004a6eb922a1c1f3c21 Mon Sep 17 00:00:00 2001 From: pk910 Date: Tue, 28 Jun 2011 22:23:50 +0200 Subject: [PATCH] m_join forward nicklist restriction & m_names manual nicklist restriction --- ircd/m_join.c | 2 +- ircd/m_names.c | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/ircd/m_join.c b/ircd/m_join.c index 89ef8c7..88681c7 100644 --- a/ircd/m_join.c +++ b/ircd/m_join.c @@ -312,7 +312,7 @@ int m_join(struct Client *cptr, struct Client *sptr, int parc, char *parv[]) send_reply(sptr, RPL_TOPIC, chptrb->chname, chptrb->topic); send_reply(sptr, RPL_TOPICWHOTIME, chptrb->chname, chptrb->topic_nick, chptrb->topic_time); } - do_names(sptr, chptrb, NAMES_ALL|NAMES_EON); /* send /names list */ + do_names(sptr, chptrb, NAMES_ALL|NAMES_EON|(((chptrb->mode.mode & MODE_AUDITORIUM) && !(flags & CHFL_CHANOP)) ? NAMES_OPS : 0)); /* send /names list */ } } } diff --git a/ircd/m_names.c b/ircd/m_names.c index 41a48c7..13950fc 100644 --- a/ircd/m_names.c +++ b/ircd/m_names.c @@ -246,15 +246,16 @@ int m_names(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) mlen = strlen(cli_name(&me)) + 10 + strlen(cli_name(sptr)); /* List all visible channels/visible members */ - + struct Membership *member; for (ch2ptr = GlobalChannelList; ch2ptr; ch2ptr = ch2ptr->next) { if (!ShowChannel(sptr, ch2ptr)) continue; /* Don't show secret chans. */ - else if (find_channel_member(sptr, ch2ptr)) - do_names(sptr, ch2ptr, showingdelayed|NAMES_ALL); /* Full list if we're in this chan. */ - else - do_names(sptr, ch2ptr, showingdelayed|NAMES_VIS); + else if ((member = find_channel_member(sptr, ch2ptr))) { + + do_names(sptr, ch2ptr, showingdelayed|NAMES_ALL|((chptr->mode.mode & MODE_AUDITORIUM) && !(member->status & MODE_CHANOP) ? NAMES_OPS : 0)); /* Full list if we're in this chan. */ + } else + do_names(sptr, ch2ptr, showingdelayed|NAMES_VIS|((chptr->mode.mode & MODE_AUDITORIUM) ? NAMES_OPS : 0)); } /* List all remaining users on channel '*' */ -- 2.20.1