summaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2015-01-25 16:02:46 +0100
committerSébastien Helleu <flashcode@flashtux.org>2015-01-25 16:02:46 +0100
commit0fade5ccd0a7a029ae0ef42fb4666e2a6a4308b9 (patch)
tree226fe124e50503f4afe68ed36ce8f99becc5d618 /src/plugins
parent939c7b29c00d642e72a9195e07cf096bf3049686 (diff)
downloadweechat-0fade5ccd0a7a029ae0ef42fb4666e2a6a4308b9.zip
irc: move account callback to keep protocol callbacks sorted alphabetically
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/irc/irc-protocol.c68
1 files changed, 34 insertions, 34 deletions
diff --git a/src/plugins/irc/irc-protocol.c b/src/plugins/irc/irc-protocol.c
index 509fc9d6e..3238bdbb4 100644
--- a/src/plugins/irc/irc-protocol.c
+++ b/src/plugins/irc/irc-protocol.c
@@ -194,6 +194,38 @@ irc_protocol_nick_address (struct t_irc_server *server,
}
/*
+ * 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".
*
* Message looks like:
@@ -295,38 +327,6 @@ IRC_PROTOCOL_CALLBACK(away)
}
/*
- * 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.
*
* Message looks like:
@@ -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 },