diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2011-01-03 13:02:22 +0100 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2011-01-03 13:02:22 +0100 |
commit | b38dfac5ee715dd4b7108eb38e1b1d11b7b478a3 (patch) | |
tree | 1c82581987df760fa55dc19f9846eecc17618d3b | |
parent | 77852924285aa7fc2e5b5110833495799b28803c (diff) | |
download | weechat-b38dfac5ee715dd4b7108eb38e1b1d11b7b478a3.zip |
Update nick modes with IRC message 221 (bug #32038)
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | src/plugins/irc/irc-mode.c | 14 | ||||
-rw-r--r-- | src/plugins/irc/irc-mode.h | 3 | ||||
-rw-r--r-- | src/plugins/irc/irc-protocol.c | 6 |
4 files changed, 21 insertions, 5 deletions
@@ -1,7 +1,7 @@ WeeChat ChangeLog ================= Sébastien Helleu <flashcode@flashtux.org> -v0.3.4-rc2, 2011-01-02 +v0.3.4-rc2, 2011-01-03 Version 0.3.4 (under dev!) @@ -49,6 +49,7 @@ Version 0.3.4 (under dev!) nicklist_nick_get_integer, nicklist_nick_get_string, nicklist_nick_get_pointer, nicklist_nick_set * alias: complete with alias value for second argument of command /alias +* irc: update nick modes with message 221 (bug #32038) * irc: add option "-server" to command /join (task #10837) * irc: fix bug with charset decoding on private buffers (decoding was made for local nick instead of remote nick) (bug #31890) diff --git a/src/plugins/irc/irc-mode.c b/src/plugins/irc/irc-mode.c index 2283eed2b..16522d27d 100644 --- a/src/plugins/irc/irc-mode.c +++ b/src/plugins/irc/irc-mode.c @@ -227,10 +227,19 @@ irc_mode_user_remove (struct t_irc_server *server, char mode) */ void -irc_mode_user_set (struct t_irc_server *server, const char *modes) +irc_mode_user_set (struct t_irc_server *server, const char *modes, + int reset_modes) { char set_flag; - + + if (reset_modes) + { + if (server->nick_modes) + { + free (server->nick_modes); + server->nick_modes = NULL; + } + } set_flag = '+'; while (modes && modes[0]) { @@ -254,4 +263,5 @@ irc_mode_user_set (struct t_irc_server *server, const char *modes) } modes++; } + weechat_bar_item_update ("input_prompt"); } diff --git a/src/plugins/irc/irc-mode.h b/src/plugins/irc/irc-mode.h index fdccae8e3..fc44a9a61 100644 --- a/src/plugins/irc/irc-mode.h +++ b/src/plugins/irc/irc-mode.h @@ -26,6 +26,7 @@ struct t_irc_channel; extern int irc_mode_channel_set (struct t_irc_server *server, struct t_irc_channel *channel, const char *modes); -extern void irc_mode_user_set (struct t_irc_server *server, const char *modes); +extern void irc_mode_user_set (struct t_irc_server *server, const char *modes, + int reset_modes); #endif /* __WEECHAT_IRC_MODE_H */ diff --git a/src/plugins/irc/irc-protocol.c b/src/plugins/irc/irc-protocol.c index 61b768457..e321d6981 100644 --- a/src/plugins/irc/irc-protocol.c +++ b/src/plugins/irc/irc-protocol.c @@ -770,7 +770,7 @@ IRC_PROTOCOL_CALLBACK(mode) IRC_COLOR_CHAT_NICK, nick); } - irc_mode_user_set (server, pos_modes); + irc_mode_user_set (server, pos_modes, 0); } return WEECHAT_RC_OK; @@ -1938,6 +1938,10 @@ IRC_PROTOCOL_CALLBACK(221) (argv_eol[3][0] == ':') ? argv_eol[3] + 1 : argv_eol[3], IRC_COLOR_CHAT_DELIMITERS); + irc_mode_user_set (server, + (argv_eol[3][0] == ':') ? argv_eol[3] + 1 : argv_eol[3], + 1); + return WEECHAT_RC_OK; } |