Add away-notify support

This commit is contained in:
TingPing
2013-03-12 02:21:18 -04:00
parent c76dedd9b9
commit bf0fb9f327
6 changed files with 39 additions and 2 deletions

View File

@@ -1016,6 +1016,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;
@@ -1153,6 +1158,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;
@@ -1180,6 +1190,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)
{