diff --git a/src/fe-common/core/fe-common-core.c b/src/fe-common/core/fe-common-core.c index 7de62e67..1fc1fbaf 100644 --- a/src/fe-common/core/fe-common-core.c +++ b/src/fe-common/core/fe-common-core.c @@ -72,7 +72,6 @@ void fe_common_core_init(void) settings_add_bool("lookandfeel", "use_status_window", FALSE); settings_add_bool("lookandfeel", "use_msgs_window", FALSE); /*settings_add_bool("lookandfeel", "autoraise_msgs_window", FALSE);*/ - settings_add_bool("lookandfeel", "autocreate_query", TRUE); /*settings_add_bool("lookandfeel", "use_tabbed_windows", TRUE); settings_add_int("lookandfeel", "tab_orientation", 3);*/ settings_add_str("lookandfeel", "current_theme", "default"); diff --git a/src/fe-common/irc/fe-events.c b/src/fe-common/irc/fe-events.c index 45ee9e85..c0a9e64e 100644 --- a/src/fe-common/irc/fe-events.c +++ b/src/fe-common/irc/fe-events.c @@ -111,7 +111,7 @@ static void event_privmsg(const char *data, IRC_SERVER_REC *server, const char * print_channel_msg(server, msg, nick, addr, target); } else { /* private message */ - item = (WI_ITEM_REC *) privmsg_get_query(server, nick); + item = (WI_ITEM_REC *) privmsg_get_query(server, nick, FALSE); printformat(server, nick, MSGLEVEL_MSGS, item == NULL ? IRCTXT_MSG_PRIVATE : IRCTXT_MSG_PRIVATE_QUERY, nick, addr, msg); } @@ -151,7 +151,7 @@ static void ctcp_msg_check_action(gchar *data, IRC_SERVER_REC *server, gchar *ni } } else { /* private action */ - item = (WI_ITEM_REC *) privmsg_get_query(server, nick); + item = (WI_ITEM_REC *) privmsg_get_query(server, nick, FALSE); printformat(server, nick, MSGLEVEL_ACTIONS, item == NULL ? IRCTXT_ACTION_PRIVATE : IRCTXT_ACTION_PRIVATE_QUERY, nick, addr == NULL ? "" : addr, data); diff --git a/src/fe-common/irc/fe-irc-commands.c b/src/fe-common/irc/fe-irc-commands.c index 669daf19..900b0a2c 100644 --- a/src/fe-common/irc/fe-irc-commands.c +++ b/src/fe-common/irc/fe-irc-commands.c @@ -154,7 +154,7 @@ static void cmd_msg(gchar *data, IRC_SERVER_REC *server, WI_ITEM_REC *item) else { /* private message */ - item = (WI_ITEM_REC *) privmsg_get_query(server, target); + item = (WI_ITEM_REC *) privmsg_get_query(server, target, TRUE); printformat(server, target, MSGLEVEL_MSGS | MSGLEVEL_NOHILIGHT, item == NULL ? IRCTXT_OWN_MSG_PRIVATE : IRCTXT_OWN_MSG_PRIVATE_QUERY, target, msg, server->nick); } diff --git a/src/fe-common/irc/fe-query.c b/src/fe-common/irc/fe-query.c index df011777..4413be38 100644 --- a/src/fe-common/irc/fe-query.c +++ b/src/fe-common/irc/fe-query.c @@ -35,12 +35,13 @@ static int queryclose_tag, query_auto_close; /* Return query where to put the private message. */ -QUERY_REC *privmsg_get_query(IRC_SERVER_REC *server, const char *nick) +QUERY_REC *privmsg_get_query(IRC_SERVER_REC *server, const char *nick, int own) { QUERY_REC *query; query = query_find(server, nick); - if (query == NULL && settings_get_bool("autocreate_query")) + if (query == NULL && settings_get_bool("autocreate_query") && + (!own || settings_get_bool("autocreate_own_query"))) query = query_create(server, nick, TRUE); return query; @@ -173,7 +174,7 @@ static int sig_query_autoclose(void) static void read_settings(void) { - query_auto_close = settings_get_int("query_auto_close"); + query_auto_close = settings_get_int("autoclose_query"); if (query_auto_close > 0 && queryclose_tag == -1) queryclose_tag = g_timeout_add(5000, (GSourceFunc) sig_query_autoclose, NULL); else if (query_auto_close <= 0 && queryclose_tag != -1) { @@ -184,7 +185,9 @@ static void read_settings(void) void fe_query_init(void) { - settings_add_int("lookandfeel", "query_auto_close", 0); + settings_add_bool("lookandfeel", "autocreate_query", TRUE); + settings_add_bool("lookandfeel", "autocreate_own_query", TRUE); + settings_add_int("lookandfeel", "autoclose_query", 0); queryclose_tag = -1; read_settings(); diff --git a/src/fe-common/irc/fe-query.h b/src/fe-common/irc/fe-query.h index da13bba7..a9cbaaaf 100644 --- a/src/fe-common/irc/fe-query.h +++ b/src/fe-common/irc/fe-query.h @@ -2,6 +2,6 @@ #define __FE_QUERY_H /* Return query where to put the private message. */ -QUERY_REC *privmsg_get_query(IRC_SERVER_REC *server, const char *nick); +QUERY_REC *privmsg_get_query(IRC_SERVER_REC *server, const char *nick, int own); #endif