From 3b8a6350f8de279e70a2ef07ed73a559bfd13331 Mon Sep 17 00:00:00 2001 From: Stephen Bennett Date: Sun, 2 May 2010 21:29:22 +0100 Subject: [PATCH] Backed out changeset c57955c5225e Now that MLOCK is no longer stored as a struct Mode, this is unnecessary. --- include/channel.h | 4 +--- src/channel.c | 25 ++++++++++++------------- 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/include/channel.h b/include/channel.h index e37dd3ae1..ec6690afd 100644 --- a/include/channel.h +++ b/include/channel.h @@ -238,9 +238,7 @@ extern void channel_member_names(struct Channel *chptr, struct Client *, extern void del_invite(struct Channel *chptr, struct Client *who); -const char *channel_modes_real(struct Channel *chptr, struct Mode *mode, struct Client *who); -#define channel_modes(chptr, who) channel_modes_real(chptr, &(chptr)->mode, who) -#define channel_mlock(chptr, who) channel_modes_real(chptr, &(chptr)->mode_lock, who) +const char *channel_modes(struct Channel *chptr, struct Client *who); extern struct Channel *find_bannickchange_channel(struct Client *client_p); diff --git a/src/channel.c b/src/channel.c index 3b0516bd6..c959687a5 100644 --- a/src/channel.c +++ b/src/channel.c @@ -1073,10 +1073,9 @@ set_channel_topic(struct Channel *chptr, const char *topic, const char *topic_in } } -/* channel_modes_real() +/* channel_modes() * * inputs - pointer to channel - * - pointer to channel Mode struct * - pointer to client * output - string with simple modes * side effects - result from previous calls overwritten @@ -1084,7 +1083,7 @@ set_channel_topic(struct Channel *chptr, const char *topic, const char *topic_in * Stolen from ShadowIRCd 4 --nenolod */ const char * -channel_modes_real(struct Channel *chptr, struct Mode *mode, struct Client *client_p) +channel_modes(struct Channel *chptr, struct Client *client_p) { int i; char buf1[BUFSIZE]; @@ -1097,40 +1096,40 @@ channel_modes_real(struct Channel *chptr, struct Mode *mode, struct Client *clie *pbuf = '\0'; for (i = 0; i < 256; i++) - if(mode->mode & chmode_flags[i]) + if(chptr->mode.mode & chmode_flags[i]) *mbuf++ = i; - if(mode->limit) + if(chptr->mode.limit) { *mbuf++ = 'l'; if(!IsClient(client_p) || IsMember(client_p, chptr)) - pbuf += rb_sprintf(pbuf, " %d", mode->limit); + pbuf += rb_sprintf(pbuf, " %d", chptr->mode.limit); } - if(*mode->key) + if(*chptr->mode.key) { *mbuf++ = 'k'; if(pbuf > buf2 || !IsClient(client_p) || IsMember(client_p, chptr)) - pbuf += rb_sprintf(pbuf, " %s", mode->key); + pbuf += rb_sprintf(pbuf, " %s", chptr->mode.key); } - if(mode->join_num) + if(chptr->mode.join_num) { *mbuf++ = 'j'; if(pbuf > buf2 || !IsClient(client_p) || IsMember(client_p, chptr)) - pbuf += rb_sprintf(pbuf, " %d:%d", mode->join_num, - mode->oin_time); + pbuf += rb_sprintf(pbuf, " %d:%d", chptr->mode.join_num, + chptr->mode.join_time); } - if(*mode->forward && (ConfigChannel.use_forward || !IsClient(client_p))) + if(*chptr->mode.forward && (ConfigChannel.use_forward || !IsClient(client_p))) { *mbuf++ = 'f'; if(pbuf > buf2 || !IsClient(client_p) || IsMember(client_p, chptr)) - pbuf += rb_sprintf(pbuf, " %s", mode->forward); + pbuf += rb_sprintf(pbuf, " %s", chptr->mode.forward); } *mbuf = '\0';