Rough implementation of the new account-notify client capability.

This replaces identify-msg in ircd-seven.
This commit is contained in:
William Pitcock 2010-12-15 23:04:57 -06:00
parent 7a948bdaa7
commit 7a7f86d344
3 changed files with 7 additions and 1 deletions

View File

@ -443,6 +443,7 @@ struct ListClient
#define CLICAP_MULTI_PREFIX 0x0001
#define CLICAP_SASL 0x0002
#define CLICAP_ACCOUNT_NOTIFY 0x0004
/*
* flags macros.

View File

@ -69,7 +69,8 @@ static struct clicap
int namelen;
} clicap_list[] = {
_CLICAP("multi-prefix", CLICAP_MULTI_PREFIX, 0, 0),
_CLICAP("sasl", CLICAP_SASL, 0, 0)
_CLICAP("sasl", CLICAP_SASL, 0, 0),
_CLICAP("account-notify", CLICAP_ACCOUNT_NOTIFY, 0, 0)
};
#define CLICAP_LIST_LEN (sizeof(clicap_list) / sizeof(struct clicap))

View File

@ -107,6 +107,10 @@ me_su(struct Client *client_p, struct Client *source_p,
else
rb_strlcpy(target_p->user->suser, parv[2], sizeof(target_p->user->suser));
sendto_common_channels_local_butone(target_p, CLICAP_ACCOUNT_NOTIFY, ":%s!%s@%s ACCOUNT :%s",
target_p->name, target_p->username, target_p->host,
EmptyString(target_p->user->suser) ? "*" : target_p->user->suser);
invalidate_bancache_user(target_p);
return 0;