summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/plugins/irc/irc-buffer.c27
-rw-r--r--src/plugins/irc/irc-buffer.h2
-rw-r--r--src/plugins/irc/irc-command.c4
-rw-r--r--src/plugins/irc/irc-server.c14
4 files changed, 38 insertions, 9 deletions
diff --git a/src/plugins/irc/irc-buffer.c b/src/plugins/irc/irc-buffer.c
index c20136dd4..fe0eb5e03 100644
--- a/src/plugins/irc/irc-buffer.c
+++ b/src/plugins/irc/irc-buffer.c
@@ -179,9 +179,22 @@ irc_buffer_merge_servers ()
if (irc_buffer_servers)
{
- weechat_buffer_set (irc_buffer_servers, "name", "servers");
+ weechat_buffer_set (irc_buffer_servers,
+ "name", IRC_BUFFER_ALL_SERVERS_NAME);
+ weechat_buffer_set (irc_buffer_servers,
+ "short_name", IRC_BUFFER_ALL_SERVERS_NAME);
weechat_buffer_set (irc_buffer_servers, "key_bind_meta-s",
"/command irc /server switch");
+ weechat_buffer_set (irc_buffer_servers,
+ "localvar_set_server", IRC_BUFFER_ALL_SERVERS_NAME);
+ weechat_buffer_set (irc_buffer_servers,
+ "localvar_set_channel", IRC_BUFFER_ALL_SERVERS_NAME);
+ weechat_hook_signal_send ("logger_stop",
+ WEECHAT_HOOK_SIGNAL_POINTER,
+ irc_buffer_servers);
+ weechat_hook_signal_send ("logger_start",
+ WEECHAT_HOOK_SIGNAL_POINTER,
+ irc_buffer_servers);
for (ptr_server = irc_servers; ptr_server;
ptr_server = ptr_server->next_server)
@@ -226,6 +239,18 @@ irc_buffer_split_server ()
snprintf (buffer_name, sizeof (buffer_name),
"server.%s", irc_current_server->name);
weechat_buffer_set (irc_current_server->buffer, "name", buffer_name);
+ weechat_buffer_set (irc_current_server->buffer,
+ "short_name", irc_current_server->name);
+ weechat_buffer_set (irc_current_server->buffer,
+ "localvar_set_server", irc_current_server->name);
+ weechat_buffer_set (irc_current_server->buffer,
+ "localvar_set_channel", irc_current_server->name);
+ weechat_hook_signal_send ("logger_stop",
+ WEECHAT_HOOK_SIGNAL_POINTER,
+ irc_current_server->buffer);
+ weechat_hook_signal_send ("logger_start",
+ WEECHAT_HOOK_SIGNAL_POINTER,
+ irc_current_server->buffer);
}
irc_buffer_servers = NULL;
diff --git a/src/plugins/irc/irc-buffer.h b/src/plugins/irc/irc-buffer.h
index 205e87045..a8d7fdea7 100644
--- a/src/plugins/irc/irc-buffer.h
+++ b/src/plugins/irc/irc-buffer.h
@@ -20,6 +20,8 @@
#ifndef __WEECHAT_IRC_BUFFER_H
#define __WEECHAT_IRC_BUFFER_H 1
+#define IRC_BUFFER_ALL_SERVERS_NAME "servers"
+
struct t_gui_buffer;
struct t_irc_server;
struct t_irc_channel;
diff --git a/src/plugins/irc/irc-command.c b/src/plugins/irc/irc-command.c
index 12b6bbc54..f378362f2 100644
--- a/src/plugins/irc/irc-command.c
+++ b/src/plugins/irc/irc-command.c
@@ -3171,10 +3171,6 @@ irc_command_server (void *data, struct t_gui_buffer *buffer, int argc,
}
}
}
- weechat_buffer_set (irc_current_server->buffer, "short_name",
- irc_current_server->name);
- weechat_buffer_set (irc_current_server->buffer, "localvar_set_server",
- irc_current_server->name);
weechat_bar_item_update ("buffer_name");
weechat_bar_item_update ("input_prompt");
return WEECHAT_RC_OK;
diff --git a/src/plugins/irc/irc-server.c b/src/plugins/irc/irc-server.c
index a801dac3d..298448225 100644
--- a/src/plugins/irc/irc-server.c
+++ b/src/plugins/irc/irc-server.c
@@ -2108,7 +2108,7 @@ irc_server_create_buffer (struct t_irc_server *server, int all_servers)
if (all_servers)
{
snprintf (buffer_name, sizeof (buffer_name),
- "servers");
+ IRC_BUFFER_ALL_SERVERS_NAME);
}
else
{
@@ -2121,9 +2121,15 @@ irc_server_create_buffer (struct t_irc_server *server, int all_servers)
if (!server->buffer)
return NULL;
- weechat_buffer_set (server->buffer, "short_name", server->name);
- weechat_buffer_set (server->buffer, "localvar_set_server", server->name);
- weechat_buffer_set (server->buffer, "localvar_set_channel", server->name);
+ weechat_buffer_set (server->buffer, "short_name",
+ (weechat_config_boolean (irc_config_look_one_server_buffer)) ?
+ IRC_BUFFER_ALL_SERVERS_NAME : server->name);
+ weechat_buffer_set (server->buffer, "localvar_set_server",
+ (weechat_config_boolean (irc_config_look_one_server_buffer)) ?
+ IRC_BUFFER_ALL_SERVERS_NAME : server->name);
+ weechat_buffer_set (server->buffer, "localvar_set_channel",
+ (weechat_config_boolean (irc_config_look_one_server_buffer)) ?
+ IRC_BUFFER_ALL_SERVERS_NAME : server->name);
weechat_hook_signal_send ("logger_backlog",
WEECHAT_HOOK_SIGNAL_POINTER, server->buffer);