diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2005-11-29 08:23:03 +0000 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2005-11-29 08:23:03 +0000 |
commit | c005d8c4d3578a3a1fcc1d2998958fa4387136c3 (patch) | |
tree | a2ceec4e0231aa9cad5a894312941d87c8530ebd /src/plugins | |
parent | 816fac508478548fb6affc8d3bcc0c503960f316 (diff) | |
download | weechat-c005d8c4d3578a3a1fcc1d2998958fa4387136c3.zip |
Added server/channel arg to /buffer command for jumping to buffer
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/plugins-interface.c | 3 | ||||
-rw-r--r-- | src/plugins/plugins.c | 57 | ||||
-rw-r--r-- | src/plugins/plugins.h | 1 |
3 files changed, 2 insertions, 59 deletions
diff --git a/src/plugins/plugins-interface.c b/src/plugins/plugins-interface.c index 861856c2d..12083faf4 100644 --- a/src/plugins/plugins-interface.c +++ b/src/plugins/plugins-interface.c @@ -37,6 +37,7 @@ #include "../common/command.h" #include "../common/weeconfig.h" #include "../irc/irc.h" +#include "../gui/gui.h" /* @@ -165,7 +166,7 @@ weechat_plugin_printf (t_weechat_plugin *plugin, if (!plugin || !message) return; - ptr_buffer = plugin_find_buffer (server, channel); + ptr_buffer = gui_buffer_search (server, channel); va_start (argptr, message); vsnprintf (buf, sizeof (buf) - 1, message, argptr); va_end (argptr); diff --git a/src/plugins/plugins.c b/src/plugins/plugins.c index e34f7e752..3b1d62c45 100644 --- a/src/plugins/plugins.c +++ b/src/plugins/plugins.c @@ -48,63 +48,6 @@ t_weechat_plugin *last_weechat_plugin = NULL; /* - * plugin_find_buffer: find a buffer for text display - */ - -t_gui_buffer * -plugin_find_buffer (char *server, char *channel) -{ - t_irc_server *ptr_server; - t_irc_channel *ptr_channel; - t_gui_buffer *ptr_buffer; - - ptr_server = NULL; - ptr_channel = NULL; - ptr_buffer = NULL; - - /* nothing given => print on current buffer */ - if ((!server || !server[0]) && (!channel || !channel[0])) - ptr_buffer = gui_current_window->buffer; - else - { - if (server && server[0]) - { - ptr_server = server_search (server); - if (!ptr_server) - return NULL; - } - else - { - ptr_server = SERVER(gui_current_window->buffer); - if (!ptr_server) - ptr_server = SERVER(gui_buffers); - } - - if (channel && channel[0]) - { - if (ptr_server) - { - ptr_channel = channel_search (ptr_server, channel); - if (ptr_channel) - ptr_buffer = ptr_channel->buffer; - } - } - else - { - if (ptr_server) - ptr_buffer = ptr_server->buffer; - else - ptr_buffer = gui_current_window->buffer; - } - } - - if (!ptr_buffer) - return NULL; - - return (ptr_buffer->dcc) ? gui_buffers : ptr_buffer; -} - -/* * plugin_find_server_channel: find server/channel for command execution */ diff --git a/src/plugins/plugins.h b/src/plugins/plugins.h index 5f7a96565..3c05e0f3b 100644 --- a/src/plugins/plugins.h +++ b/src/plugins/plugins.h @@ -31,7 +31,6 @@ typedef void (t_weechat_end_func) (t_weechat_plugin *); extern t_weechat_plugin *weechat_plugins; extern t_weechat_plugin *last_weechat_plugin; -extern t_gui_buffer *plugin_find_buffer (char *, char *); extern void plugin_find_server_channel (char *, char *, t_irc_server **, t_irc_channel **); extern void plugin_exec_on_files (t_weechat_plugin *, char *, |