44 |
|
#include "resv.h" |
45 |
|
|
46 |
|
|
47 |
< |
dlink_list global_channel_list; |
47 |
> |
dlink_list channel_list; |
48 |
|
mp_pool_t *ban_pool; /*! \todo ban_pool shouldn't be a global var */ |
49 |
|
|
50 |
|
static mp_pool_t *member_pool, *channel_pool; |
160 |
|
{ |
161 |
|
const struct Membership *ms = ptr->data; |
162 |
|
|
163 |
< |
tlen = strlen(ms->client_p->id) + 1; /* nick + space */ |
163 |
> |
tlen = strlen(ms->client_p->id) + 1; /* +1 for space */ |
164 |
|
|
165 |
|
if (ms->flags & CHFL_CHANOP) |
166 |
|
++tlen; |
203 |
|
/*! \brief Sends +b/+e/+I |
204 |
|
* \param client_p Client pointer to server |
205 |
|
* \param chptr Pointer to channel |
206 |
< |
* \param top Pointer to top of mode link list to send |
206 |
> |
* \param list Pointer to list of modes to send |
207 |
|
* \param flag Char flag flagging type of mode. Currently this can be 'b', e' or 'I' |
208 |
|
*/ |
209 |
|
static void |
210 |
|
send_mode_list(struct Client *client_p, struct Channel *chptr, |
211 |
< |
const dlink_list *top, char flag) |
211 |
> |
const dlink_list *list, char flag) |
212 |
|
{ |
213 |
|
const dlink_node *ptr = NULL; |
214 |
|
char pbuf[IRCD_BUFSIZE] = ""; |
215 |
|
int tlen, mlen, cur_len; |
216 |
|
char *pp = pbuf; |
217 |
|
|
218 |
< |
if (top->length == 0) |
218 |
> |
if (list->length == 0) |
219 |
|
return; |
220 |
|
|
221 |
|
mlen = snprintf(buf, sizeof(buf), ":%s BMASK %lu %s %c :", me.id, |
222 |
|
(unsigned long)chptr->channelts, chptr->chname, flag); |
223 |
|
cur_len = mlen; |
224 |
|
|
225 |
< |
DLINK_FOREACH(ptr, top->head) |
225 |
> |
DLINK_FOREACH(ptr, list->head) |
226 |
|
{ |
227 |
|
const struct Ban *banptr = ptr->data; |
228 |
|
|
229 |
< |
tlen = banptr->len + 3; |
229 |
> |
tlen = banptr->len + 3; /* +3 for ! + @ + space */ |
230 |
|
|
231 |
|
/* |
232 |
< |
* Send buffer and start over if we cannot fit another ban, |
233 |
< |
* or if the target is non-ts6 and we have too many modes in |
234 |
< |
* in this line. |
232 |
> |
* Send buffer and start over if we cannot fit another ban |
233 |
|
*/ |
234 |
|
if (cur_len + (tlen - 1) > IRCD_BUFSIZE - 2) |
235 |
|
{ |
349 |
|
chptr->last_join_time = CurrentTime; |
350 |
|
|
351 |
|
strlcpy(chptr->chname, chname, sizeof(chptr->chname)); |
352 |
< |
dlinkAdd(chptr, &chptr->node, &global_channel_list); |
352 |
> |
dlinkAdd(chptr, &chptr->node, &channel_list); |
353 |
|
|
354 |
|
hash_add_channel(chptr); |
355 |
|
|
372 |
|
free_channel_list(&chptr->exceptlist); |
373 |
|
free_channel_list(&chptr->invexlist); |
374 |
|
|
375 |
< |
dlinkDelete(&chptr->node, &global_channel_list); |
375 |
> |
dlinkDelete(&chptr->node, &channel_list); |
376 |
|
hash_del_channel(chptr); |
377 |
|
|
378 |
|
mp_pool_release(chptr); |
425 |
|
continue; |
426 |
|
|
427 |
|
if (!uhnames) |
428 |
< |
tlen = strlen(ms->client_p->name) + 1; /* nick + space */ |
428 |
> |
tlen = strlen(ms->client_p->name) + 1; /* +1 for space */ |
429 |
|
else |
430 |
|
tlen = strlen(ms->client_p->name) + strlen(ms->client_p->username) + |
431 |
< |
strlen(ms->client_p->host) + 3; |
431 |
> |
strlen(ms->client_p->host) + 3; /* +3 for ! + @ + space */ |
432 |
|
|
433 |
|
if (!multi_prefix) |
434 |
|
{ |
526 |
|
const char * |
527 |
|
get_member_status(const struct Membership *ms, const int combine) |
528 |
|
{ |
529 |
< |
static char buffer[4]; |
529 |
> |
static char buffer[4]; /* 4 for @%+\0 */ |
530 |
|
char *p = buffer; |
531 |
|
|
532 |
|
if (ms->flags & CHFL_CHANOP) |
688 |
|
for (; *p; ++p) |
689 |
|
{ |
690 |
|
if (*p > 31 || *p == 1) |
691 |
< |
continue; /* CTCP or no control code */ |
691 |
> |
continue; /* No control code or CTCP */ |
692 |
|
|
693 |
|
if (*p == 27) /* Escape */ |
694 |
|
{ |
850 |
|
"Network split, activating splitmode"); |
851 |
|
eventAddIsh("check_splitmode", check_splitmode, NULL, 10); |
852 |
|
} |
853 |
< |
else if (splitmode && (server > split_servers) && (Count.total > split_users)) |
853 |
> |
else if (splitmode && (server >= split_servers) && (Count.total >= split_users)) |
854 |
|
{ |
855 |
|
splitmode = 0; |
856 |
|
|
869 |
|
* \param local Whether the topic is set by a local client |
870 |
|
*/ |
871 |
|
void |
872 |
< |
set_channel_topic(struct Channel *chptr, const char *topic, |
872 |
> |
channel_set_topic(struct Channel *chptr, const char *topic, |
873 |
|
const char *topic_info, time_t topicts, int local) |
874 |
|
{ |
875 |
|
if (local) |
1005 |
|
if (splitmode && !HasUMode(source_p, UMODE_OPER) && |
1006 |
|
ConfigChannel.no_join_on_split) |
1007 |
|
{ |
1008 |
< |
sendto_one_numeric(source_p, &me, ERR_UNAVAILRESOURCE, chan); |
1008 |
> |
sendto_one_numeric(source_p, &me, ERR_UNAVAILRESOURCE, chptr->chname); |
1009 |
|
continue; |
1010 |
|
} |
1011 |
|
|