From 87e9c6476bb11f882d25aca718c7011599dd2237 Mon Sep 17 00:00:00 2001 From: Sebastien Helleu Date: Mon, 6 Jul 2009 20:03:19 +0200 Subject: Open channel/pv near server when no channel/pv is opened (with option irc.look.open_*_near_server) --- src/plugins/irc/irc-channel.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/plugins/irc/irc-channel.c b/src/plugins/irc/irc-channel.c index 33744d95f..8dc9c06ca 100644 --- a/src/plugins/irc/irc-channel.c +++ b/src/plugins/irc/irc-channel.c @@ -116,14 +116,22 @@ irc_channel_move_near_server (struct t_irc_server *server, int channel_type, number_found = number_last_channel + 1; break; } - - /* switch to number found */ - if ((number_found >= 1) && (number_found != number)) + } + else + { + if (weechat_config_integer (irc_config_look_server_buffer) == + IRC_CONFIG_LOOK_SERVER_BUFFER_INDEPENDENT) { - snprintf (str_number, sizeof (str_number), "%d", number_found); - weechat_buffer_set (buffer, "number", str_number); + number_found = weechat_buffer_get_integer (server->buffer, "number") + 1; } } + + /* switch to number found */ + if ((number_found >= 1) && (number_found != number)) + { + snprintf (str_number, sizeof (str_number), "%d", number_found); + weechat_buffer_set (buffer, "number", str_number); + } } /* -- cgit v1.2.3