Permalink
Browse files

- Add support for account-notify client capability (#4098). This capa…

…bility

  can be used to request passive notifications for accountname changes.
  • Loading branch information...
1 parent b0c8d94 commit 3b8010faa4f8167d9fa73cd3f0fa7f181c0deab6 @kaniini kaniini committed Apr 9, 2012
Showing with 9 additions and 0 deletions.
  1. +2 −0 Changes
  2. +1 −0 include/struct.h
  3. +1 −0 src/modules/m_cap.c
  4. +5 −0 src/modules/m_svsmode.c
View
@@ -2424,3 +2424,5 @@
reported by katsklaw, patch from warg (#4036).
- Added 'away-notify' client capability, which informs the client of any AWAY
state changes of users on the same channel. Patch from nenolod (#4097).
+- Add support for account-notify client capability (#4098). This capability
+ can be used to request passive notifications for accountname changes.
View
@@ -371,6 +371,7 @@ typedef unsigned int u_int32_t; /* XXX Hope this works! */
#define PROTO_STARTTLS 0x40000 /* client supports STARTTLS */
#define PROTO_SASL 0x80000 /* client is doing SASL */
#define PROTO_AWAY_NOTIFY 0x100000 /* client supports away-notify */
+#define PROTO_ACCOUNT_NOTIFY 0x200000 /* client supports account-notify */
/*
* flags macros.
View
@@ -72,6 +72,7 @@ struct clicap {
#define CLICAP_FLAGS_CLIACK 0x2
static struct clicap clicap_table[] = {
+ {"account-notify", PROTO_ACCOUNT_NOTIFY, CLICAP_FLAGS_NONE},
{"away-notify", PROTO_AWAY_NOTIFY, CLICAP_FLAGS_NONE},
{"multi-prefix", PROTO_NAMESX, CLICAP_FLAGS_NONE},
{"sasl", PROTO_SASL, CLICAP_FLAGS_NONE},
@@ -514,7 +514,12 @@ char *xtok = show_change ? TOK_SVS2MODE : TOK_SVSMODE;
goto setmodex;
case 'd':
if (parv[3])
+ {
strlcpy(acptr->user->svid, parv[3], sizeof(acptr->user->svid));
+ sendto_common_channels_local_butone(acptr, PROTO_ACCOUNT_NOTIFY, ":%s!%s@%s ACCOUNT %s",
+ acptr->name, acptr->user->username, GetHost(acptr),
+ !isdigit(*acptr->user->svid) ? acptr->user->svid : "*");
+ }
break;
case 'x':
if (what == MODE_DEL)

0 comments on commit 3b8010f

Please sign in to comment.