Rough implementation of the new account-notify client capability.
This replaces identify-msg in ircd-seven.
This commit is contained in:
parent
7a948bdaa7
commit
7a7f86d344
3 changed files with 7 additions and 1 deletions
|
@ -443,6 +443,7 @@ struct ListClient
|
||||||
|
|
||||||
#define CLICAP_MULTI_PREFIX 0x0001
|
#define CLICAP_MULTI_PREFIX 0x0001
|
||||||
#define CLICAP_SASL 0x0002
|
#define CLICAP_SASL 0x0002
|
||||||
|
#define CLICAP_ACCOUNT_NOTIFY 0x0004
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* flags macros.
|
* flags macros.
|
||||||
|
|
|
@ -69,7 +69,8 @@ static struct clicap
|
||||||
int namelen;
|
int namelen;
|
||||||
} clicap_list[] = {
|
} clicap_list[] = {
|
||||||
_CLICAP("multi-prefix", CLICAP_MULTI_PREFIX, 0, 0),
|
_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))
|
#define CLICAP_LIST_LEN (sizeof(clicap_list) / sizeof(struct clicap))
|
||||||
|
|
|
@ -107,6 +107,10 @@ me_su(struct Client *client_p, struct Client *source_p,
|
||||||
else
|
else
|
||||||
rb_strlcpy(target_p->user->suser, parv[2], sizeof(target_p->user->suser));
|
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);
|
invalidate_bancache_user(target_p);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in a new issue