50 |
|
static mp_pool_t *channel_pool = NULL; |
51 |
|
|
52 |
|
static char buf[IRCD_BUFSIZE]; |
53 |
– |
static char modebuf[MODEBUFLEN]; |
54 |
– |
static char parabuf[MODEBUFLEN]; |
53 |
|
|
54 |
|
|
55 |
|
/*! \brief Initializes the channel blockheap, adds known channel CAPAB |
147 |
|
*/ |
148 |
|
static void |
149 |
|
send_members(struct Client *client_p, struct Channel *chptr, |
150 |
< |
char *lmodebuf, char *lparabuf) |
150 |
> |
char *modebuf, char *parabuf) |
151 |
|
{ |
152 |
|
const dlink_node *ptr = NULL; |
153 |
|
int tlen; /* length of text to append */ |
154 |
|
char *t, *start; /* temp char pointer */ |
155 |
|
|
156 |
|
start = t = buf + snprintf(buf, sizeof(buf), ":%s SJOIN %lu %s %s %s:", |
157 |
< |
ID_or_name(&me, client_p), |
158 |
< |
(unsigned long)chptr->channelts, |
161 |
< |
chptr->chname, lmodebuf, lparabuf); |
157 |
> |
me.id, (unsigned long)chptr->channelts, |
158 |
> |
chptr->chname, modebuf, parabuf); |
159 |
|
|
160 |
|
DLINK_FOREACH(ptr, chptr->members.head) |
161 |
|
{ |
162 |
|
const struct Membership *ms = ptr->data; |
163 |
|
|
164 |
< |
tlen = strlen(ID(ms->client_p)) + 1; /* nick + space */ |
164 |
> |
tlen = strlen(ms->client_p->id) + 1; /* nick + space */ |
165 |
|
|
166 |
|
if (ms->flags & CHFL_CHANOP) |
167 |
|
tlen++; |
189 |
|
if (ms->flags & CHFL_VOICE) |
190 |
|
*t++ = '+'; |
191 |
|
|
192 |
< |
strcpy(t, ID(ms->client_p)); |
192 |
> |
strcpy(t, ms->client_p->id); |
193 |
|
|
194 |
|
t += strlen(t); |
195 |
|
*t++ = ' '; |
213 |
|
const dlink_list *top, char flag) |
214 |
|
{ |
215 |
|
const dlink_node *lp = NULL; |
216 |
< |
char pbuf[IRCD_BUFSIZE]; |
216 |
> |
char pbuf[IRCD_BUFSIZE] = ""; |
217 |
|
int tlen, mlen, cur_len, count = 0; |
218 |
|
char *pp = pbuf; |
219 |
|
|
220 |
< |
if (top == NULL || top->length == 0) |
220 |
> |
if (top->length == 0) |
221 |
|
return; |
222 |
|
|
223 |
|
mlen = snprintf(buf, sizeof(buf), ":%s BMASK %lu %s %c :", me.id, |
262 |
|
void |
263 |
|
send_channel_modes(struct Client *client_p, struct Channel *chptr) |
264 |
|
{ |
265 |
< |
*modebuf = *parabuf = '\0'; |
265 |
> |
char modebuf[MODEBUFLEN] = ""; |
266 |
> |
char parabuf[MODEBUFLEN] = ""; |
267 |
> |
|
268 |
|
channel_modes(chptr, client_p, modebuf, parabuf); |
269 |
|
send_members(client_p, chptr, modebuf, parabuf); |
270 |
|
|
409 |
|
int show_eon) |
410 |
|
{ |
411 |
|
const dlink_node *ptr = NULL; |
412 |
< |
char lbuf[IRCD_BUFSIZE + 1]; |
412 |
> |
char lbuf[IRCD_BUFSIZE + 1] = ""; |
413 |
|
char *t = NULL, *start = NULL; |
414 |
|
int tlen = 0; |
415 |
|
int is_member = IsMember(source_p, chptr); |
467 |
|
ms->client_p->host); |
468 |
|
} |
469 |
|
|
470 |
< |
if (tlen != 0) |
470 |
> |
if (tlen) |
471 |
|
{ |
472 |
|
*(t - 1) = '\0'; |
473 |
|
sendto_one(source_p, "%s", lbuf); |
657 |
|
int |
658 |
|
has_member_flags(const struct Membership *ms, const unsigned int flags) |
659 |
|
{ |
660 |
< |
if (ms != NULL) |
662 |
< |
return ms->flags & flags; |
663 |
< |
return 0; |
660 |
> |
return ms && (ms->flags & flags); |
661 |
|
} |
662 |
|
|
663 |
|
struct Membership * |
831 |
|
} |
832 |
|
} |
833 |
|
|
834 |
< |
if (name != NULL) |
834 |
> |
if (name) |
835 |
|
source_p->localClient->last_join_time = CurrentTime; |
836 |
|
else |
837 |
|
source_p->localClient->last_leave_time = CurrentTime; |