240 |
msg_channel(int p_or_n, struct Client *source_p, struct Channel *chptr, |
msg_channel(int p_or_n, struct Client *source_p, struct Channel *chptr, |
241 |
unsigned int flags, const char *text) |
unsigned int flags, const char *text) |
242 |
{ |
{ |
|
int result = 0; |
|
243 |
unsigned int type = 0; |
unsigned int type = 0; |
244 |
const char *prefix = ""; |
const char *prefix = ""; |
245 |
|
|
260 |
} |
} |
261 |
|
|
262 |
/* Chanops and voiced can flood their own channel with impunity */ |
/* Chanops and voiced can flood their own channel with impunity */ |
263 |
if ((result = can_send(chptr, source_p, NULL, text, p_or_n == NOTICE)) < 0) |
int ret = can_send(chptr, source_p, NULL, text, p_or_n == NOTICE); |
264 |
|
if (ret < 0) |
265 |
{ |
{ |
266 |
if (result == CAN_SEND_OPV || |
if (ret == CAN_SEND_OPV || !flood_attack_channel(p_or_n, source_p, chptr)) |
|
!flood_attack_channel(p_or_n, source_p, chptr)) |
|
267 |
sendto_channel_butone(source_p, source_p, chptr, type, "%s %s%s :%s", |
sendto_channel_butone(source_p, source_p, chptr, type, "%s %s%s :%s", |
268 |
command[p_or_n], prefix, chptr->name, text); |
command[p_or_n], prefix, chptr->name, text); |
269 |
} |
} |
270 |
else if (p_or_n != NOTICE) |
else if (p_or_n != NOTICE) |
271 |
sendto_one_numeric(source_p, &me, result, chptr->name, text); |
sendto_one_numeric(source_p, &me, ret, chptr->name, text); |
272 |
} |
} |
273 |
|
|
274 |
/* msg_client() |
/* msg_client() |