diff options
Diffstat (limited to 'src/plugins/irc')
-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 |
3 files changed, 19 insertions, 4 deletions
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; } |