From 12421a67da6c80c1b1cbdbf9241d18263673bdb2 Mon Sep 17 00:00:00 2001 From: Sebastien Helleu Date: Tue, 30 Sep 2008 15:39:25 +0200 Subject: Set unread marker for IRC server/channels/pv buffers when using /away command --- src/plugins/irc/irc-buffer.c | 2 +- src/plugins/irc/irc-command.c | 15 +++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) (limited to 'src/plugins') diff --git a/src/plugins/irc/irc-buffer.c b/src/plugins/irc/irc-buffer.c index 2e744dd8b..c20136dd4 100644 --- a/src/plugins/irc/irc-buffer.c +++ b/src/plugins/irc/irc-buffer.c @@ -209,7 +209,7 @@ irc_buffer_split_server () if (irc_buffer_servers) { - weechat_buffer_set (irc_buffer_servers, "key_unbind_meta-s", NULL); + weechat_buffer_set (irc_buffer_servers, "key_unbind_meta-s", ""); } for (ptr_server = irc_servers; ptr_server; diff --git a/src/plugins/irc/irc-command.c b/src/plugins/irc/irc-command.c index 5604c4a0b..dd69d7684 100644 --- a/src/plugins/irc/irc-command.c +++ b/src/plugins/irc/irc-command.c @@ -256,6 +256,7 @@ irc_command_away_server (struct t_irc_server *server, const char *arguments) { char *string, buffer[4096]; time_t time_now, elapsed; + struct t_irc_channel *ptr_channel; if (!server) return; @@ -291,14 +292,16 @@ irc_command_away_server (struct t_irc_server *server, const char *arguments) free (string); } irc_server_set_away (server, server->nick, 1); - /*for (ptr_window = gui_windows; ptr_window; - ptr_window = ptr_window->next_window) + + /* reset "unread" indicator on server and channels/pv buffers */ + if (!weechat_config_boolean (irc_config_look_one_server_buffer)) + weechat_buffer_set (server->buffer, "unread", ""); + for (ptr_channel = server->channels; ptr_channel; + ptr_channel = ptr_channel->next_channel) { - if (strcmp (ptr_window->buffer->category, server->name) == 0) - ptr_window->buffer->last_read_line = - ptr_window->buffer->last_line; + weechat_buffer_set (ptr_channel->buffer, "unread", ""); } - */ + weechat_printf (NULL, "set unread"); } else { -- cgit v1.2.3