From 7199e72cd97fc5d688a23897c8195b3035e2786f Mon Sep 17 00:00:00 2001 From: pk910 Date: Tue, 28 Jun 2011 22:04:25 +0200 Subject: [PATCH] added MODE_AUDITORIUM /names refresh on op/deop --- ircd/channel.c | 10 +++++++--- ircd/m_join.c | 2 +- ircd/m_svsjoin.c | 4 ++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/ircd/channel.c b/ircd/channel.c index d1511be..c839fa2 100644 --- a/ircd/channel.c +++ b/ircd/channel.c @@ -2339,9 +2339,9 @@ struct ParseState { struct Membership *member; int parc; char **parv; - unsigned int flags; + ulong64 flags; ulong64 dir; - unsigned int done; + ulong64 done; ulong64 add; ulong64 del; int args_used; @@ -2349,7 +2349,7 @@ struct ParseState { int numbans; struct Ban banlist[MAXPARA]; struct { - unsigned int flag; + ulong64 flag; unsigned short oplevel; struct Client *client; } cli_change[MAXPARA]; @@ -3515,6 +3515,10 @@ mode_process_clients(struct ParseState *state) modebuf_mode_client(state->mbuf, state->cli_change[i].flag, state->cli_change[i].client, state->cli_change[i].oplevel); + + if(MyUser(state->sptr) && (state->chptr->mode.mode & MODE_AUDITORIUM) && (state->cli_change[i].flag & MODE_CHANOP)) { + do_names(state->sptr, state->chptr, NAMES_ALL|NAMES_EON|((member->status & MODE_CHANOP) ? 0 : NAMES_OPS)); + } } /* for (i = 0; state->cli_change[i].flags; i++) */ } diff --git a/ircd/m_join.c b/ircd/m_join.c index 6a93769..3bc64b6 100644 --- a/ircd/m_join.c +++ b/ircd/m_join.c @@ -354,7 +354,7 @@ int m_join(struct Client *cptr, struct Client *sptr, int parc, char *parv[]) chptr->topic_time); } - do_names(sptr, chptr, NAMES_ALL|NAMES_EON); /* send /names list */ + do_names(sptr, chptr, NAMES_ALL|NAMES_EON|(((chptr->mode.mode & MODE_AUDITORIUM) && !(flags & CHFL_CHANOP)) ? NAMES_OPS : 0)); /* send /names list */ } joinbuf_flush(&join); /* must be first, if there's a JOIN 0 */ diff --git a/ircd/m_svsjoin.c b/ircd/m_svsjoin.c index 94156fd..f79e4cc 100644 --- a/ircd/m_svsjoin.c +++ b/ircd/m_svsjoin.c @@ -87,7 +87,7 @@ int m_svsjoin(struct Client *cptr, struct Client *sptr, int parc, char *parv[]) send_reply(acptr, RPL_TOPIC, chptr->chname, chptr->topic); send_reply(acptr, RPL_TOPICWHOTIME, chptr->chname, chptr->topic_nick, chptr->topic_time); } - do_names(acptr, chptr, NAMES_ALL|NAMES_EON); + do_names(acptr, chptr, NAMES_ALL|NAMES_EON|(((chptr->mode.mode & MODE_AUDITORIUM) && !(flags & CHFL_CHANOP)) ? NAMES_OPS : 0)); joinbuf_flush(&join); joinbuf_flush(&create); @@ -154,7 +154,7 @@ signed int ms_svsjoin(struct Client* cptr, struct Client* sptr, signed int parc, send_reply(acptr, RPL_TOPIC, chptr->chname, chptr->topic); send_reply(acptr, RPL_TOPICWHOTIME, chptr->chname, chptr->topic_nick, chptr->topic_time); } - do_names(acptr, chptr, NAMES_ALL|NAMES_EON); + do_names(acptr, chptr, NAMES_ALL|NAMES_EON|(((chptr->mode.mode & MODE_AUDITORIUM) && !(flags & CHFL_CHANOP)) ? NAMES_OPS : 0)); joinbuf_flush(&join); joinbuf_flush(&create); -- 2.20.1