diff options
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | src/common/command.c | 16 | ||||
-rw-r--r-- | src/common/completion.c | 25 | ||||
-rw-r--r-- | weechat/ChangeLog | 3 | ||||
-rw-r--r-- | weechat/src/common/command.c | 16 | ||||
-rw-r--r-- | weechat/src/common/completion.c | 25 |
6 files changed, 66 insertions, 22 deletions
@@ -1,12 +1,13 @@ WeeChat - Wee Enhanced Environment for Chat =========================================== -ChangeLog - 2005-02-13 +ChangeLog - 2005-02-15 Version 0.1.1 (under dev!): * on server buffer, only server messages are logged * plugins messages are logged with new config option (log_plugin_msg) + * fixed /buffer close command (now ok when disconnected from server) * fixed display bugs when many windows are opened Version 0.1.0 (2005-02-12): diff --git a/src/common/command.c b/src/common/command.c index 5eec62a7a..cbbadff5b 100644 --- a/src/common/command.c +++ b/src/common/command.c @@ -833,6 +833,7 @@ weechat_cmd_buffer (int argc, char **argv) { t_gui_buffer *ptr_buffer; t_irc_server *ptr_server; + t_irc_channel *ptr_channel; long number; char *error; @@ -922,10 +923,23 @@ weechat_cmd_buffer (int argc, char **argv) else { if (SERVER(gui_current_window->buffer)) - irc_cmd_send_part (SERVER(gui_current_window->buffer), NULL); + { + if (SERVER(gui_current_window->buffer)->is_connected) + irc_cmd_send_part (SERVER(gui_current_window->buffer), NULL); + else + { + ptr_channel = channel_search (SERVER(gui_current_window->buffer), + CHANNEL(gui_current_window->buffer)->name); + if (ptr_channel) + channel_free (SERVER(gui_current_window->buffer), + ptr_channel); + gui_buffer_free (gui_current_window->buffer, 1); + } + } else gui_buffer_free (gui_current_window->buffer, 1); } + gui_draw_buffer_status (gui_current_window->buffer, 1); } else if (strcasecmp (argv[0], "notify") == 0) { diff --git a/src/common/completion.c b/src/common/completion.c index f0aea7cd1..bedf6b8b3 100644 --- a/src/common/completion.c +++ b/src/common/completion.c @@ -145,18 +145,25 @@ completion_build_list (t_completion *completion, void *channel) "-all"); return; } - if (((strcasecmp (completion->base_command, "connect") == 0) - || (strcasecmp (completion->base_command, "connect") == 0)) - && (completion->base_command_arg == 1)) + if ((strcasecmp (completion->base_command, "connect") == 0) + || (strcasecmp (completion->base_command, "disconnect") == 0)) { - for (ptr_server = irc_servers; ptr_server; - ptr_server = ptr_server->next_server) + if (completion->base_command_arg == 1) { - weelist_add (&completion->completion_list, - &completion->last_completion, - ptr_server->name); + for (ptr_server = irc_servers; ptr_server; + ptr_server = ptr_server->next_server) + { + weelist_add (&completion->completion_list, + &completion->last_completion, + ptr_server->name); + } + return; + } + else + { + completion_stop (completion); + return; } - return; } if ((strcasecmp (completion->base_command, "help") == 0) && (completion->base_command_arg == 1)) diff --git a/weechat/ChangeLog b/weechat/ChangeLog index 35b5062b0..a3f05d04c 100644 --- a/weechat/ChangeLog +++ b/weechat/ChangeLog @@ -1,12 +1,13 @@ WeeChat - Wee Enhanced Environment for Chat =========================================== -ChangeLog - 2005-02-13 +ChangeLog - 2005-02-15 Version 0.1.1 (under dev!): * on server buffer, only server messages are logged * plugins messages are logged with new config option (log_plugin_msg) + * fixed /buffer close command (now ok when disconnected from server) * fixed display bugs when many windows are opened Version 0.1.0 (2005-02-12): diff --git a/weechat/src/common/command.c b/weechat/src/common/command.c index 5eec62a7a..cbbadff5b 100644 --- a/weechat/src/common/command.c +++ b/weechat/src/common/command.c @@ -833,6 +833,7 @@ weechat_cmd_buffer (int argc, char **argv) { t_gui_buffer *ptr_buffer; t_irc_server *ptr_server; + t_irc_channel *ptr_channel; long number; char *error; @@ -922,10 +923,23 @@ weechat_cmd_buffer (int argc, char **argv) else { if (SERVER(gui_current_window->buffer)) - irc_cmd_send_part (SERVER(gui_current_window->buffer), NULL); + { + if (SERVER(gui_current_window->buffer)->is_connected) + irc_cmd_send_part (SERVER(gui_current_window->buffer), NULL); + else + { + ptr_channel = channel_search (SERVER(gui_current_window->buffer), + CHANNEL(gui_current_window->buffer)->name); + if (ptr_channel) + channel_free (SERVER(gui_current_window->buffer), + ptr_channel); + gui_buffer_free (gui_current_window->buffer, 1); + } + } else gui_buffer_free (gui_current_window->buffer, 1); } + gui_draw_buffer_status (gui_current_window->buffer, 1); } else if (strcasecmp (argv[0], "notify") == 0) { diff --git a/weechat/src/common/completion.c b/weechat/src/common/completion.c index f0aea7cd1..bedf6b8b3 100644 --- a/weechat/src/common/completion.c +++ b/weechat/src/common/completion.c @@ -145,18 +145,25 @@ completion_build_list (t_completion *completion, void *channel) "-all"); return; } - if (((strcasecmp (completion->base_command, "connect") == 0) - || (strcasecmp (completion->base_command, "connect") == 0)) - && (completion->base_command_arg == 1)) + if ((strcasecmp (completion->base_command, "connect") == 0) + || (strcasecmp (completion->base_command, "disconnect") == 0)) { - for (ptr_server = irc_servers; ptr_server; - ptr_server = ptr_server->next_server) + if (completion->base_command_arg == 1) { - weelist_add (&completion->completion_list, - &completion->last_completion, - ptr_server->name); + for (ptr_server = irc_servers; ptr_server; + ptr_server = ptr_server->next_server) + { + weelist_add (&completion->completion_list, + &completion->last_completion, + ptr_server->name); + } + return; + } + else + { + completion_stop (completion); + return; } - return; } if ((strcasecmp (completion->base_command, "help") == 0) && (completion->base_command_arg == 1)) |