1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-29 14:26:39 +02:00

irc: move account callback to keep protocol callbacks sorted alphabetically

This commit is contained in:
Sébastien Helleu
2015-01-25 16:02:46 +01:00
parent 939c7b29c0
commit 0fade5ccd0
+34 -34
View File
@@ -193,6 +193,38 @@ irc_protocol_nick_address (struct t_irc_server *server,
return string;
}
/*
* Callback for the IRC message "ACCOUNT": account info about a nick
* (with capability "account-notify").
*
* Message looks like:
* :nick!user@host ACCOUNT *
* :nick!user@host ACCOUNT accountname
*/
IRC_PROTOCOL_CALLBACK(account)
{
struct t_irc_channel *ptr_channel;
struct t_irc_nick *ptr_nick;
IRC_PROTOCOL_MIN_ARGS(3);
for (ptr_channel = server->channels; ptr_channel;
ptr_channel = ptr_channel->next_channel)
{
ptr_nick = irc_nick_search (server, ptr_channel, nick);
if (ptr_nick)
{
if (ptr_nick->account)
free (ptr_nick->account);
ptr_nick->account = (server->cap_account_notify) ?
strdup (argv[2]) : strdup ("*");
}
}
return WEECHAT_RC_OK;
}
/*
* Callback for the IRC message "AUTHENTICATE".
*
@@ -294,38 +326,6 @@ IRC_PROTOCOL_CALLBACK(away)
return WEECHAT_RC_OK;
}
/*
* Callback for the IRC message "ACCOUNT": account info about a nick
* (with capability "account-notify").
*
* Message looks like:
* :nick!user@host ACCOUNT *
* :nick!user@host ACCOUNT accountname
*/
IRC_PROTOCOL_CALLBACK(account)
{
struct t_irc_channel *ptr_channel;
struct t_irc_nick *ptr_nick;
IRC_PROTOCOL_MIN_ARGS(3);
for (ptr_channel = server->channels; ptr_channel;
ptr_channel = ptr_channel->next_channel)
{
ptr_nick = irc_nick_search (server, ptr_channel, nick);
if (ptr_nick)
{
if (ptr_nick->account)
free (ptr_nick->account);
ptr_nick->account = (server->cap_account_notify) ?
strdup (argv[2]) : strdup ("*");
}
}
return WEECHAT_RC_OK;
}
/*
* Callback for the IRC message "CAP": client capability.
*
@@ -5395,9 +5395,9 @@ irc_protocol_recv_command (struct t_irc_server *server,
char **argv, **argv_eol;
struct t_hashtable *hash_tags;
struct t_irc_protocol_msg irc_protocol_messages[] =
{ { "authenticate", /* authenticate */ 1, 0, &irc_protocol_cb_authenticate },
{ { "account", /* account (cap account-notify) */ 1, 0, &irc_protocol_cb_account },
{ "authenticate", /* authenticate */ 1, 0, &irc_protocol_cb_authenticate },
{ "away", /* away (cap away-notify) */ 1, 0, &irc_protocol_cb_away },
{ "account", /* account (cap account-notify) */ 1, 0, &irc_protocol_cb_account },
{ "cap", /* client capability */ 1, 0, &irc_protocol_cb_cap },
{ "error", /* error received from IRC server */ 1, 0, &irc_protocol_cb_error },
{ "invite", /* invite a nick on a channel */ 1, 0, &irc_protocol_cb_invite },