Added /SET reuse_unused_windows setting, default is OFF

If window_close_on_part is ON, we don't anymore close the window if we
get kicked or connection gets lost. Also don't close DCC chat window if
the other side disconnects.


git-svn-id: http://svn.irssi.org/repos/irssi/trunk@357 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2000-06-17 12:22:56 +00:00 committed by cras
commit 8ea2400269
7 changed files with 30 additions and 10 deletions

View file

@ -25,6 +25,7 @@
#include "commands.h"
#include "levels.h"
#include "misc.h"
#include "settings.h"
#include "irc.h"
#include "channels.h"
@ -54,7 +55,14 @@ static void signal_channel_destroyed(CHANNEL_REC *channel)
g_return_if_fail(channel != NULL);
window = window_item_window((WI_ITEM_REC *) channel);
if (window != NULL) window_remove_item(window, (WI_ITEM_REC *) channel);
if (window != NULL) {
window_remove_item(window, (WI_ITEM_REC *) channel);
if (windows->next != NULL && (!channel->joined || channel->left) &&
settings_get_bool("window_close_on_part")) {
window_destroy(window);
}
}
}
static void signal_window_item_removed(WINDOW_REC *window, WI_ITEM_REC *item)
@ -235,6 +243,8 @@ static void cmd_channel_remove(const char *data)
void fe_channels_init(void)
{
settings_add_bool("lookandfeel", "window_close_on_part", TRUE);
signal_add("channel created", (SIGNAL_FUNC) signal_channel_created);
signal_add("channel destroyed", (SIGNAL_FUNC) signal_channel_destroyed);
signal_add("window item remove", (SIGNAL_FUNC) signal_window_item_removed);