* ircd-ratbox: A slightly useful ircd.
* channel.c: Controls channels.
*
- * Copyright (C) 1990 Jarkko Oikarinen and University of Oulu, Co Center
- * Copyright (C) 1996-2002 Hybrid Development Team
- * Copyright (C) 2002-2005 ircd-ratbox development team
+ * Copyright (C) 1990 Jarkko Oikarinen and University of Oulu, Co Center
+ * Copyright (C) 1996-2002 Hybrid Development Team
+ * Copyright (C) 2002-2005 ircd-ratbox development team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
#include "s_newconf.h"
#include "logger.h"
#include "ipv4_from_ipv6.h"
+#include "s_assert.h"
struct config_channel_entry ConfigChannel;
rb_dlink_list global_channel_list;
client_p->name, client_p->username, client_p->host, chptr->chname,
EmptyString(client_p->user->suser) ? "*" : client_p->user->suser,
client_p->info);
+
+ /* Send away message to away-notify enabled clients. */
+ if (client_p->user->away)
+ sendto_channel_local_with_capability_butone(client_p, ALL_MEMBERS, CLICAP_AWAY_NOTIFY, NOCAPS, chptr,
+ ":%s!%s@%s AWAY :%s", client_p->name, client_p->username,
+ client_p->host, client_p->user->away);
}
/* find_channel_membership()
/* add_user_to_channel()
*
* input - channel to add client to, client to add, channel flags
- * output -
+ * output -
* side effects - user is added to channel
*/
void
if(IsInvisible(target_p) && !is_member)
continue;
- /* space, possible "@+" prefix */
- if(cur_len + strlen(target_p->name) + 3 >= BUFSIZE - 3)
+ if (IsCapable(client_p, CLICAP_USERHOST_IN_NAMES))
{
- *(t - 1) = '\0';
- sendto_one(client_p, "%s", lbuf);
- cur_len = mlen;
- t = lbuf + mlen;
+ /* space, possible "@+" prefix */
+ if (cur_len + strlen(target_p->name) + strlen(target_p->username) + strlen(target_p->host) + 5 >= BUFSIZE - 5)
+ {
+ *(t - 1) = '\0';
+ sendto_one(client_p, "%s", lbuf);
+ cur_len = mlen;
+ t = lbuf + mlen;
+ }
+
+ tlen = rb_sprintf(t, "%s%s!%s@%s ", find_channel_status(msptr, stack),
+ target_p->name, target_p->username, target_p->host);
}
+ else
+ {
+ /* space, possible "@+" prefix */
+ if(cur_len + strlen(target_p->name) + 3 >= BUFSIZE - 3)
+ {
+ *(t - 1) = '\0';
+ sendto_one(client_p, "%s", lbuf);
+ cur_len = mlen;
+ t = lbuf + mlen;
+ }
- tlen = rb_sprintf(t, "%s%s ", find_channel_status(msptr, stack),
- target_p->name);
+ tlen = rb_sprintf(t, "%s%s ", find_channel_status(msptr, stack),
+ target_p->name);
+ }
cur_len += tlen;
t += tlen;
/* join throttling stuff --nenolod */
else if(chptr->mode.join_num > 0 && chptr->mode.join_time > 0)
{
- if ((rb_current_time() - chptr->join_delta <=
+ if ((rb_current_time() - chptr->join_delta <=
chptr->mode.join_time) && (chptr->join_count >=
chptr->mode.join_num))
i = ERR_THROTTLE;
hook_data_channel_approval moduledata;
moduledata.approved = CAN_SEND_NONOP;
+ moduledata.dir = MODE_QUERY;
if(IsServer(source_p) || IsService(source_p))
return CAN_SEND_OPV;
moduledata.chptr = msptr->chptr;
moduledata.msptr = msptr;
moduledata.target = NULL;
+ moduledata.dir = (moduledata.approved == CAN_SEND_NO) ? MODE_ADD : MODE_QUERY;
call_hook(h_can_send, &moduledata);
* flood_attack_channel
* inputs - flag 0 if PRIVMSG 1 if NOTICE. RFC
* says NOTICE must not auto reply
- * - pointer to source Client
+ * - pointer to source Client
* - pointer to target channel
* output - 1 if target is under flood attack
* side effects - check for flood attack on target chptr
/* Basically we allocate one large block for the topic and
* the topic info. We then split it up into two and shove it
- * in the chptr
+ * in the chptr
*/
chptr->topic = ptr;
chptr->topic_info = (char *) ptr + TOPICLEN + 1;
int i, mbl, pbl, nc, mc, preflen, len;
char *pbuf;
const char *arg;
- int cap;
- int nocap;
int dir;
int arglen;
if (mode_changes[i].letter == 0)
continue;
- cap = mode_changes[i].caps;
- nocap = mode_changes[i].nocaps;
-
if (!EmptyString(mode_changes[i].id))
arg = mode_changes[i].id;
else
((mbl + pbl + arglen + 4) > (BUFSIZE - 3))))
{
if(nc != 0)
- sendto_server(client_p, chptr, cap, nocap,
+ sendto_server(client_p, chptr, NOCAPS, NOCAPS,
"%s %s", modebuf, parabuf);
nc = 0;
mc = 0;
parabuf[pbl - 1] = 0;
if(nc != 0)
- sendto_server(client_p, chptr, cap, nocap, "%s %s", modebuf, parabuf);
+ sendto_server(client_p, chptr, NOCAPS, NOCAPS, "%s %s", modebuf, parabuf);
}
void
/* notify opers & user they were removed from the channel */
sendto_realops_snomask(SNO_GENERAL, L_ALL,
"Forced PART for %s!%s@%s from %s (%s)",
- target_p->name, target_p->username,
+ target_p->name, target_p->username,
target_p->host, name, reason);
if(temp_time > 0)