struct Channel *, unsigned int,
int is_ctcp,
const char *, ...) AFP(6,7);
-extern void sendto_common_channels_local(struct Client *, int, unsigned int,
- const char *, ...) AFP(4,5);
+extern void sendto_common_channels_local(struct Client *, int, unsigned int, unsigned int,
+ const char *, ...) AFP(5,6);
extern void sendto_channel_local(unsigned int, int, struct Channel *,
const char *, ...) AFP(4,5);
-extern void sendto_channel_local_butone(struct Client *, unsigned int, unsigned int, struct Channel *,
- const char *, ...) AFP(5,6);
+extern void sendto_channel_local_butone(struct Client *, unsigned int, unsigned int, unsigned int, struct Channel *,
+ const char *, ...) AFP(6,7);
extern void sendto_server(struct Client *,
const unsigned int,
const unsigned int, const char *, ...) AFP(4,5);
sendto_channel_local(ALL_MEMBERS, 0, chptr, ":%s MODE %s +nt",
me.name, chptr->chname);
if (source_p->away[0])
- sendto_channel_local_butone(source_p, 0, CAP_AWAY_NOTIFY, chptr,
+ sendto_channel_local_butone(source_p, 0, CAP_AWAY_NOTIFY, 0, chptr,
":%s!%s@%s AWAY :%s",
source_p->name, source_p->username,
source_p->host, source_p->away);
source_p->host, chptr->chname);
if (source_p->away[0])
- sendto_channel_local_butone(source_p, 0, CAP_AWAY_NOTIFY, chptr,
+ sendto_channel_local_butone(source_p, 0, CAP_AWAY_NOTIFY, 0, chptr,
":%s!%s@%s AWAY :%s",
source_p->name, source_p->username,
source_p->host, source_p->away);
source_p->name, source_p->username,
source_p->host, chptr->chname);
if (source_p->away[0])
- sendto_channel_local_butone(source_p, 0, CAP_AWAY_NOTIFY, chptr,
+ sendto_channel_local_butone(source_p, 0, CAP_AWAY_NOTIFY, 0, chptr,
":%s!%s@%s AWAY :%s",
source_p->name, source_p->username,
source_p->host, source_p->away);
sendto_snomask(SNO_NCHANGE, L_ALL,
"Nick change: From %s to %s [%s@%s]",
source_p->name, nick, source_p->username, source_p->realhost);
- sendto_common_channels_local(source_p, 1, 0, ":%s!%s@%s NICK :%s",
+ sendto_common_channels_local(source_p, 1, 0, 0, ":%s!%s@%s NICK :%s",
source_p->name, source_p->username,
source_p->host, nick);
whowas_add_history(source_p, 1);
source_p->name, nick, source_p->username, source_p->realhost);
#endif
- sendto_common_channels_local(source_p, 1, 0, ":%s!%s@%s NICK :%s",
+ sendto_common_channels_local(source_p, 1, 0, 0, ":%s!%s@%s NICK :%s",
source_p->name, source_p->username,
source_p->host, nick);
target_p->name, target_p->username,
target_p->host, chptr->chname);
if (target_p->away[0])
- sendto_channel_local_butone(target_p, 0, CAP_AWAY_NOTIFY, chptr,
+ sendto_channel_local_butone(target_p, 0, CAP_AWAY_NOTIFY, 0, chptr,
":%s!%s@%s AWAY :%s",
target_p->name, target_p->username,
target_p->host, target_p->away);
":%s AWAY", ID(source_p));
sendto_server(client_p, NOCAPS, CAP_TS6,
":%s AWAY", source_p->name);
- sendto_common_channels_local(source_p, 1, CAP_AWAY_NOTIFY,
+ sendto_common_channels_local(source_p, 1, CAP_AWAY_NOTIFY, 0,
":%s!%s@%s AWAY",
source_p->name, source_p->username,
source_p->host);
strlcpy(source_p->away, parv[1], sizeof(source_p->away));
- sendto_common_channels_local(source_p, 1, CAP_AWAY_NOTIFY,
+ sendto_common_channels_local(source_p, 1, CAP_AWAY_NOTIFY, 0,
":%s!%s@%s AWAY :%s",
source_p->name, source_p->username,
source_p->host, source_p->away);
":%s AWAY", ID(source_p));
sendto_server(client_p, NOCAPS, CAP_TS6,
":%s AWAY", source_p->name);
- sendto_common_channels_local(source_p, 1, CAP_AWAY_NOTIFY,
+ sendto_common_channels_local(source_p, 1, CAP_AWAY_NOTIFY, 0,
":%s!%s@%s AWAY",
source_p->name, source_p->username,
source_p->host);
strlcpy(source_p->away, parv[1], sizeof(source_p->away));
- sendto_common_channels_local(source_p, 1, CAP_AWAY_NOTIFY,
+ sendto_common_channels_local(source_p, 1, CAP_AWAY_NOTIFY, 0,
":%s!%s@%s AWAY :%s",
source_p->name, source_p->username,
source_p->host, source_p->away);
"Nick change: From %s to %s [%s@%s]",
target_p->name, parv[3], target_p->username, target_p->realhost);
- sendto_common_channels_local(target_p, 1, 0, ":%s!%s@%s NICK :%s",
+ sendto_common_channels_local(target_p, 1, 0, 0, ":%s!%s@%s NICK :%s",
target_p->name, target_p->username,
target_p->host, parv[3]);
* that the client can show the "**signoff" message).
* (Note: The notice is to the local clients *only*)
*/
- sendto_common_channels_local(source_p, 0, 0, ":%s!%s@%s QUIT :%s",
+ sendto_common_channels_local(source_p, 0, 0, 0, ":%s!%s@%s QUIT :%s",
source_p->name, source_p->username,
source_p->host, quitmsg);
DLINK_FOREACH_SAFE(lp, next_lp, source_p->channel.head)
return;
if (ConfigFileEntry.cycle_on_host_change)
- sendto_common_channels_local(target_p, 0, 0, ":%s!%s@%s QUIT :Changing hostname",
+ sendto_common_channels_local(target_p, 0, 0, CAP_CHGHOST, ":%s!%s@%s QUIT :Changing hostname",
target_p->name, target_p->username, target_p->host);
if (username)
*p = '\0';
- sendto_channel_local_butone(target_p, 0, 0, ms->chptr, ":%s!%s@%s JOIN :%s",
+ sendto_channel_local_butone(target_p, 0, 0, CAP_CHGHOST, ms->chptr, ":%s!%s@%s JOIN :%s",
target_p->name, target_p->username, target_p->host,
ms->chptr->chname);
if (nickbuf[0])
- sendto_channel_local_butone(target_p, 0, 0, ms->chptr, ":%s MODE %s +%s %s",
+ sendto_channel_local_butone(target_p, 0, 0, CAP_CHGHOST, ms->chptr, ":%s MODE %s +%s %s",
target_p->servptr->name, ms->chptr->chname,
modebuf, nickbuf);
}
if (target_p->away[0])
- sendto_common_channels_local(target_p, 0, CAP_AWAY_NOTIFY,
+ sendto_common_channels_local(target_p, 0, CAP_AWAY_NOTIFY, CAP_CHGHOST,
":%s!%s@%s AWAY :%s",
target_p->name, target_p->username,
target_p->host, target_p->away);
* used by m_nick.c and exit_one_client.
*/
void
-sendto_common_channels_local(struct Client *user, int touser, unsigned int cap,
+sendto_common_channels_local(struct Client *user, int touser,
+ unsigned int cap, unsigned int nocap,
const char *pattern, ...)
{
va_list args;
target_p->localClient->serial == current_serial)
continue;
- if (HasCap(target_p, cap) != cap)
+ if (HasCap(target_p, cap) != cap || HasCap(target_p, nocap))
continue;
target_p->localClient->serial = current_serial;
if (touser && MyConnect(user) && !IsDead(user) &&
user->localClient->serial != current_serial)
- if (HasCap(user, cap) == cap)
+ if (HasCap(user, cap) == cap && !HasCap(user, nocap))
send_message(user, buffer);
dbuf_ref_free(buffer);
* WARNING - +D clients are omitted
*/
void
-sendto_channel_local_butone(struct Client *one, unsigned int type, unsigned int cap,
+sendto_channel_local_butone(struct Client *one, unsigned int type,
+ unsigned int cap, unsigned int nocap,
struct Channel *chptr, const char *pattern, ...)
{
va_list args;
if (is_bwsave(chptr, target_p))
continue;
- if (HasCap(target_p, cap) != cap)
+ if (HasCap(target_p, cap) != cap || HasCap(target_p, nocap))
continue;
send_message(target_p, buffer);