diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2011-03-23 16:11:23 +0100 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2011-03-23 16:11:23 +0100 |
commit | b7b2cc8bd701c390e1b76b8ad95d301e1ed018b2 (patch) | |
tree | 715a3f7dcd7135ea8d6ed3d8c29fea264d88a5c5 /src/plugins/irc/irc-server.c | |
parent | 97048d57fc9a52817e0a4c59b215162ac986aab4 (diff) | |
download | weechat-b7b2cc8bd701c390e1b76b8ad95d301e1ed018b2.zip |
irc: fix local variable "away" on server buffer (set/delete it each time away is set or removed on server)
Diffstat (limited to 'src/plugins/irc/irc-server.c')
-rw-r--r-- | src/plugins/irc/irc-server.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/plugins/irc/irc-server.c b/src/plugins/irc/irc-server.c index 87a86c482..7ec3ebaab 100644 --- a/src/plugins/irc/irc-server.c +++ b/src/plugins/irc/irc-server.c @@ -3686,16 +3686,28 @@ void irc_server_set_away (struct t_irc_server *server, const char *nick, int is_away) { struct t_irc_channel *ptr_channel; - - for (ptr_channel = server->channels; ptr_channel; ptr_channel = ptr_channel->next_channel) + + if (server->is_connected) { - if (server->is_connected) + /* set/del "away" local variable on server buffer */ + if (is_away) + { + weechat_buffer_set (server->buffer, + "localvar_set_away", server->away_message); + } + else + { + weechat_buffer_set (server->buffer, + "localvar_del_away", ""); + } + + for (ptr_channel = server->channels; ptr_channel; ptr_channel = ptr_channel->next_channel) { /* set away flag for nick on channel */ if (ptr_channel->type == IRC_CHANNEL_TYPE_CHANNEL) irc_channel_set_away (server, ptr_channel, nick, is_away); - /* set/del "away" local variable */ + /* set/del "away" local variable on channel buffer */ if (is_away) { weechat_buffer_set (ptr_channel->buffer, |