143 |
if (key && *key == '\0') |
if (key && *key == '\0') |
144 |
key = NULL; |
key = NULL; |
145 |
|
|
146 |
if (!IsChanPrefix(*chan) || !check_channel_name(chan)) |
if (!check_channel_name(chan, 1)) |
147 |
{ |
{ |
148 |
sendto_one(source_p, form_str(ERR_BADCHANNAME), |
sendto_one(source_p, form_str(ERR_BADCHANNAME), |
149 |
me.name, source_p->name, chan); |
me.name, source_p->name, chan); |
157 |
continue; |
continue; |
158 |
} |
} |
159 |
|
|
|
if (strlen(chan) > LOCAL_CHANNELLEN) |
|
|
{ |
|
|
sendto_one(source_p, form_str(ERR_BADCHANNAME), |
|
|
me.name, source_p->name, chan); |
|
|
continue; |
|
|
} |
|
|
|
|
160 |
if (!IsExemptResv(source_p) && |
if (!IsExemptResv(source_p) && |
161 |
!(IsOper(source_p) && ConfigFileEntry.oper_pass_resv) && |
!(IsOper(source_p) && ConfigFileEntry.oper_pass_resv) && |
162 |
(!hash_find_resv(chan) == ConfigChannel.restrict_channels)) |
(!hash_find_resv(chan) == ConfigChannel.restrict_channels)) |
212 |
} |
} |
213 |
|
|
214 |
flags = CHFL_CHANOP; |
flags = CHFL_CHANOP; |
215 |
|
chptr = make_channel(chan); |
|
if ((chptr = get_or_create_channel(source_p, chan, NULL)) == NULL) |
|
|
{ |
|
|
sendto_one(source_p, form_str(ERR_UNAVAILRESOURCE), |
|
|
me.name, source_p->name, chan); |
|
|
continue; |
|
|
} |
|
216 |
} |
} |
217 |
|
|
218 |
if (!IsOper(source_p)) |
if (!IsOper(source_p)) |
307 |
ms_join(struct Client *client_p, struct Client *source_p, |
ms_join(struct Client *client_p, struct Client *source_p, |
308 |
int parc, char *parv[]) |
int parc, char *parv[]) |
309 |
{ |
{ |
310 |
struct Channel *chptr; |
struct Channel *chptr = NULL; |
311 |
time_t newts; |
time_t newts = 0; |
312 |
time_t oldts; |
time_t oldts = 0; |
313 |
static struct Mode mode, *oldmode; |
struct Mode mode, *oldmode; |
314 |
int args = 0; |
int args = 0; |
315 |
int keep_our_modes = 1; |
int keep_our_modes = 1; |
316 |
int keep_new_modes = 1; |
int keep_new_modes = 1; |
317 |
int isnew; |
int isnew = 0; |
318 |
char *s; |
char *s = NULL; |
319 |
const char *servername; |
const char *servername = NULL; |
320 |
|
|
321 |
if (parc == 2 && !irccmp(parv[1], "0")) |
if (parc == 2 && !irccmp(parv[1], "0")) |
322 |
{ |
{ |
324 |
return; |
return; |
325 |
} |
} |
326 |
|
|
327 |
if (parc < 4) |
if (parc < 4 || *parv[2] == '&') |
328 |
return; |
return; |
329 |
|
|
330 |
if (*parv[2] == '&' || !check_channel_name(parv[2])) |
if (!check_channel_name(parv[2], 0)) |
331 |
|
{ |
332 |
|
sendto_realops_flags(UMODE_DEBUG, L_ALL, |
333 |
|
"*** Too long or invalid channel name from %s: %s", |
334 |
|
client_p->name, parv[2]); |
335 |
return; |
return; |
336 |
|
} |
337 |
|
|
338 |
mbuf = modebuf; |
mbuf = modebuf; |
339 |
mode.mode = mode.limit = 0; |
mode.mode = mode.limit = 0; |
378 |
} |
} |
379 |
} |
} |
380 |
|
|
381 |
if ((chptr = get_or_create_channel(source_p, parv[2], &isnew)) == NULL) |
if ((chptr = hash_find_channel(parv[2])) == NULL) |
382 |
return; /* channel name too long? */ |
{ |
383 |
|
isnew = 1; |
384 |
|
chptr = make_channel(parv[2]); |
385 |
|
} |
386 |
|
|
387 |
newts = atol(parv[1]); |
newts = atol(parv[1]); |
388 |
oldts = chptr->channelts; |
oldts = chptr->channelts; |