diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2009-02-17 19:42:05 +0100 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2009-02-17 19:42:05 +0100 |
commit | e263a847da839253e346fa3843aaf7cb90199f01 (patch) | |
tree | 688440c6d3d59da43c6c0b6bdfee59b78087c487 /src | |
parent | b5f27d3fead4740099054f82e9a246ebd8a6ae9d (diff) | |
download | weechat-e263a847da839253e346fa3843aaf7cb90199f01.zip |
Add new local variable "type" for buffers
Values are set by plugins:
- irc and jabber: "server", "channel", "private", "debug"
- relay: "relay" (list)
- xfer: "xfer" (list), "private" (DCC chat)
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/irc/irc-channel.c | 2 | ||||
-rw-r--r-- | src/plugins/irc/irc-debug.c | 1 | ||||
-rw-r--r-- | src/plugins/irc/irc-server.c | 1 | ||||
-rw-r--r-- | src/plugins/jabber/jabber-debug.c | 1 | ||||
-rw-r--r-- | src/plugins/jabber/jabber-muc.c | 2 | ||||
-rw-r--r-- | src/plugins/jabber/jabber-server.c | 1 | ||||
-rw-r--r-- | src/plugins/relay/relay-buffer.c | 1 | ||||
-rw-r--r-- | src/plugins/xfer/xfer-buffer.c | 1 | ||||
-rw-r--r-- | src/plugins/xfer/xfer-chat.c | 3 |
9 files changed, 12 insertions, 1 deletions
diff --git a/src/plugins/irc/irc-channel.c b/src/plugins/irc/irc-channel.c index 9004b7df4..66b116c02 100644 --- a/src/plugins/irc/irc-channel.c +++ b/src/plugins/irc/irc-channel.c @@ -100,6 +100,8 @@ irc_channel_new (struct t_irc_server *server, int channel_type, } weechat_buffer_set (new_buffer, "short_name", channel_name); + weechat_buffer_set (new_buffer, "localvar_set_type", + (channel_type == IRC_CHANNEL_TYPE_CHANNEL) ? "channel" : "private"); weechat_buffer_set (new_buffer, "localvar_set_nick", server->nick); weechat_buffer_set (new_buffer, "localvar_set_server", server->name); weechat_buffer_set (new_buffer, "localvar_set_channel", channel_name); diff --git a/src/plugins/irc/irc-debug.c b/src/plugins/irc/irc-debug.c index 309667b76..7cb82e4f6 100644 --- a/src/plugins/irc/irc-debug.c +++ b/src/plugins/irc/irc-debug.c @@ -79,6 +79,7 @@ irc_debug_printf (struct t_irc_server *server, int send, int modified, "title", _("IRC debug messages")); weechat_buffer_set (irc_debug_buffer, "short_name", IRC_DEBUG_BUFFER_NAME); + weechat_buffer_set (irc_debug_buffer, "localvar_set_type", "debug"); weechat_buffer_set (irc_debug_buffer, "localvar_set_server", IRC_DEBUG_BUFFER_NAME); weechat_buffer_set (irc_debug_buffer, "localvar_set_channel", IRC_DEBUG_BUFFER_NAME); weechat_buffer_set (irc_debug_buffer, "localvar_set_no_log", "1"); diff --git a/src/plugins/irc/irc-server.c b/src/plugins/irc/irc-server.c index 29f61cb7f..cf4d369a2 100644 --- a/src/plugins/irc/irc-server.c +++ b/src/plugins/irc/irc-server.c @@ -2003,6 +2003,7 @@ irc_server_create_buffer (struct t_irc_server *server, int all_servers) 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_type", "server"); weechat_buffer_set (server->buffer, "localvar_set_server", (weechat_config_boolean (irc_config_look_one_server_buffer)) ? IRC_BUFFER_ALL_SERVERS_NAME : server->name); diff --git a/src/plugins/jabber/jabber-debug.c b/src/plugins/jabber/jabber-debug.c index 740fd4ee3..7ab2867bf 100644 --- a/src/plugins/jabber/jabber-debug.c +++ b/src/plugins/jabber/jabber-debug.c @@ -81,6 +81,7 @@ jabber_debug_printf (struct t_jabber_server *server, int send, int modified, "title", _("Jabber debug messages")); weechat_buffer_set (jabber_debug_buffer, "short_name", JABBER_DEBUG_BUFFER_NAME); + weechat_buffer_set (jabber_debug_buffer, "localvar_set_type", "debug"); weechat_buffer_set (jabber_debug_buffer, "localvar_set_server", JABBER_DEBUG_BUFFER_NAME); weechat_buffer_set (jabber_debug_buffer, "localvar_set_muc", JABBER_DEBUG_BUFFER_NAME); weechat_buffer_set (jabber_debug_buffer, "localvar_set_no_log", "1"); diff --git a/src/plugins/jabber/jabber-muc.c b/src/plugins/jabber/jabber-muc.c index 99e516ee6..109ffd273 100644 --- a/src/plugins/jabber/jabber-muc.c +++ b/src/plugins/jabber/jabber-muc.c @@ -97,6 +97,8 @@ jabber_muc_new (struct t_jabber_server *server, int muc_type, } weechat_buffer_set (new_buffer, "short_name", muc_name); + weechat_buffer_set (new_buffer, "localvar_set_type", + (muc_type == JABBER_MUC_TYPE_MUC) ? "channel" : "private"); weechat_buffer_set (new_buffer, "localvar_set_nick", jabber_server_get_local_name (server)); weechat_buffer_set (new_buffer, "localvar_set_server", server->name); diff --git a/src/plugins/jabber/jabber-server.c b/src/plugins/jabber/jabber-server.c index 2c49fc728..4e7215acf 100644 --- a/src/plugins/jabber/jabber-server.c +++ b/src/plugins/jabber/jabber-server.c @@ -711,6 +711,7 @@ jabber_server_create_buffer (struct t_jabber_server *server, int all_servers) weechat_buffer_set (server->buffer, "short_name", (weechat_config_boolean (jabber_config_look_one_server_buffer)) ? JABBER_BUFFER_ALL_SERVERS_NAME : server->name); + weechat_buffer_set (server->buffer, "localvar_set_type", "server"); weechat_buffer_set (server->buffer, "localvar_set_server", (weechat_config_boolean (jabber_config_look_one_server_buffer)) ? JABBER_BUFFER_ALL_SERVERS_NAME : server->name); diff --git a/src/plugins/relay/relay-buffer.c b/src/plugins/relay/relay-buffer.c index f4759b68f..e727a1f82 100644 --- a/src/plugins/relay/relay-buffer.c +++ b/src/plugins/relay/relay-buffer.c @@ -223,5 +223,6 @@ relay_buffer_open () weechat_buffer_set (relay_buffer, "title", _("List of clients for relay")); weechat_buffer_set (relay_buffer, "key_bind_meta2-A", "/relay up"); weechat_buffer_set (relay_buffer, "key_bind_meta2-B", "/relay down"); + weechat_buffer_set (relay_buffer, "localvar_set_type", "relay"); } } diff --git a/src/plugins/xfer/xfer-buffer.c b/src/plugins/xfer/xfer-buffer.c index c02a256ae..a1626d3b8 100644 --- a/src/plugins/xfer/xfer-buffer.c +++ b/src/plugins/xfer/xfer-buffer.c @@ -323,5 +323,6 @@ xfer_buffer_open () weechat_buffer_set (xfer_buffer, "title", _("Xfer list")); weechat_buffer_set (xfer_buffer, "key_bind_meta2-A", "/xfer up"); weechat_buffer_set (xfer_buffer, "key_bind_meta2-B", "/xfer down"); + weechat_buffer_set (xfer_buffer, "localvar_set_type", "xfer"); } } diff --git a/src/plugins/xfer/xfer-chat.c b/src/plugins/xfer/xfer-chat.c index f421ffaa3..c0a5df61e 100644 --- a/src/plugins/xfer/xfer-chat.c +++ b/src/plugins/xfer/xfer-chat.c @@ -206,7 +206,7 @@ xfer_chat_buffer_close_cb (void *data, struct t_gui_buffer *buffer) } /* - * xfer_chat_open_buffer: create channel for DCC chat + * xfer_chat_open_buffer: create buffer for DCC chat */ void @@ -226,6 +226,7 @@ xfer_chat_open_buffer (struct t_xfer *xfer) if (xfer->buffer) { weechat_buffer_set (xfer->buffer, "title", _("xfer chat")); + weechat_buffer_set (xfer->buffer, "localvar_set_type", "private"); weechat_printf (xfer->buffer, _("Connected to %s (%d.%d.%d.%d) via " "xfer chat"), |