Merge pull request #448 from TingPing/awaynotify2

Add away-notify support
This commit is contained in:
TingPing
2013-04-03 12:12:26 -07:00
6 changed files with 37 additions and 2 deletions

View File

@@ -1029,6 +1029,11 @@ process_named_msg (session *sess, char *type, char *word[], char *word_eol[])
inbound_quit (serv, nick, ip,
(word_eol[3][0] == ':') ? word_eol[3] + 1 : word_eol[3]);
return;
case WORDL('A','W','A','Y'):
inbound_away_notify (serv, nick,
(word_eol[3][0] == ':') ? word_eol[3] + 1 : NULL);
return;
}
goto garbage;
@@ -1166,6 +1171,11 @@ process_named_msg (session *sess, char *type, char *word[], char *word_eol[])
serv->have_namesx = TRUE;
}
if (strstr (word_eol[5], "away-notify") != 0)
{
serv->have_awaynotify = TRUE;
}
if (strstr (word_eol[5], "sasl") != 0)
{
serv->have_sasl = TRUE;
@@ -1193,6 +1203,11 @@ process_named_msg (session *sess, char *type, char *word[], char *word_eol[])
want_cap ? strcat (buffer, " multi-prefix") : strcpy (buffer, "CAP REQ :multi-prefix");
want_cap = 1;
}
if (strstr (word_eol[5], "away-notify") != 0)
{
want_cap ? strcat (buffer, " away-notify") : strcpy (buffer, "CAP REQ :away-notify");
want_cap = 1;
}
/* if the SASL password is set, request SASL auth */
if (strstr (word_eol[5], "sasl") != 0 && strlen (sess->server->saslpassword) != 0)
{