modules/core/m_join.c: remove global variable parabuf

Edit by @aaronmdjones: m_join() doesn't need it
This commit is contained in:
Simon Arlott 2017-07-29 23:19:24 +01:00 committed by Aaron Jones
parent 75399a9334
commit c41d0c0f5f
No known key found for this signature in database
GPG key ID: 8AF0737488AB3012

View file

@ -75,14 +75,12 @@ static void do_join_0(struct Client *client_p, struct Client *source_p);
static int check_channel_name_loc(struct Client *source_p, const char *name); static int check_channel_name_loc(struct Client *source_p, const char *name);
static void send_join_error(struct Client *source_p, int numeric, const char *name); static void send_join_error(struct Client *source_p, int numeric, const char *name);
static char *set_final_mode(char *mbuf, struct Mode *mode, struct Mode *oldmode); static char *set_final_mode(char *mbuf, char *parabuf, struct Mode *mode, struct Mode *oldmode);
static void remove_our_modes(struct Channel *chptr, struct Client *source_p); static void remove_our_modes(struct Channel *chptr, struct Client *source_p);
static void remove_ban_list(struct Channel *chptr, struct Client *source_p, static void remove_ban_list(struct Channel *chptr, struct Client *source_p,
rb_dlink_list * list, char c, int mems); rb_dlink_list * list, char c, int mems);
static char parabuf[MODEBUFLEN];
/* Check what we will forward to, without sending any notices to the user /* Check what we will forward to, without sending any notices to the user
* -- jilles * -- jilles
*/ */
@ -391,6 +389,7 @@ static int
ms_join(struct Client *client_p, struct Client *source_p, int parc, const char *parv[]) ms_join(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
{ {
static char modebuf[MODEBUFLEN]; static char modebuf[MODEBUFLEN];
static char parabuf[MODEBUFLEN];
struct Channel *chptr; struct Channel *chptr;
static struct Mode mode; static struct Mode mode;
time_t oldts; time_t oldts;
@ -462,7 +461,7 @@ ms_join(struct Client *client_p, struct Client *source_p, int parc, const char *
/* Lost the TS, other side wins, so remove modes on this side */ /* Lost the TS, other side wins, so remove modes on this side */
if(!keep_our_modes) if(!keep_our_modes)
{ {
mbuf = set_final_mode(mbuf, &mode, &chptr->mode); mbuf = set_final_mode(mbuf, parabuf, &mode, &chptr->mode);
chptr->mode = mode; chptr->mode = mode;
remove_our_modes(chptr, source_p); remove_our_modes(chptr, source_p);
RB_DLINK_FOREACH_SAFE(ptr, next_ptr, chptr->invites.head) RB_DLINK_FOREACH_SAFE(ptr, next_ptr, chptr->invites.head)
@ -512,6 +511,7 @@ static int
ms_sjoin(struct Client *client_p, struct Client *source_p, int parc, const char *parv[]) ms_sjoin(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
{ {
static char modebuf[MODEBUFLEN]; static char modebuf[MODEBUFLEN];
static char parabuf[MODEBUFLEN];
static char buf_uid[BUFSIZE]; static char buf_uid[BUFSIZE];
static const char empty_modes[] = "0"; static const char empty_modes[] = "0";
struct Channel *chptr; struct Channel *chptr;
@ -720,7 +720,7 @@ ms_sjoin(struct Client *client_p, struct Client *source_p, int parc, const char
chptr->join_count = chptr->join_delta = 0; chptr->join_count = chptr->join_delta = 0;
} }
mbuf = set_final_mode(mbuf, &mode, oldmode); mbuf = set_final_mode(mbuf, parabuf, &mode, oldmode);
chptr->mode = mode; chptr->mode = mode;
/* Lost the TS, other side wins, so remove modes on this side */ /* Lost the TS, other side wins, so remove modes on this side */
@ -1057,7 +1057,7 @@ send_join_error(struct Client *source_p, int numeric, const char *name)
} }
static char * static char *
set_final_mode(char *mbuf, struct Mode *mode, struct Mode *oldmode) set_final_mode(char *mbuf, char *parabuf, struct Mode *mode, struct Mode *oldmode)
{ {
int dir = MODE_QUERY; int dir = MODE_QUERY;
char *pbuf = parabuf; char *pbuf = parabuf;