From f0cf56bda495c252d6d56105b05507a083721647 Mon Sep 17 00:00:00 2001 From: Emanuele Giaquinta Date: Sat, 16 Jun 2007 14:58:13 +0000 Subject: Revert r4549. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4555 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/fe-common/core/fe-channels.c | 31 ++++++++----------------------- src/fe-common/core/fe-queries.c | 29 ++++++++--------------------- 2 files changed, 16 insertions(+), 44 deletions(-) (limited to 'src/fe-common') diff --git a/src/fe-common/core/fe-channels.c b/src/fe-common/core/fe-channels.c index 1e9ff267..a3325ef8 100644 --- a/src/fe-common/core/fe-channels.c +++ b/src/fe-common/core/fe-channels.c @@ -49,18 +49,9 @@ static void signal_channel_created(CHANNEL_REC *channel, void *automatic) static void signal_channel_created_curwin(CHANNEL_REC *channel) { - WINDOW_REC *window; - int refnum; - g_return_if_fail(channel != NULL); - window = NULL; - refnum = GPOINTER_TO_INT(signal_get_user_data()); - if (refnum > 0) - window = window_find_refnum(refnum); - if (window == NULL) - window = active_win; - window_item_add(window, (WI_ITEM_REC *) channel, window != active_win); + window_item_add(active_win, (WI_ITEM_REC *) channel, FALSE); } static void signal_channel_destroyed(CHANNEL_REC *channel) @@ -124,7 +115,6 @@ static void cmd_wjoin_pre(const char *data, SERVER_REC *server) GHashTable *optlist; char *nick; void *free_arg; - char *arg; if (!cmd_get_params(data, &free_arg, 1 | PARAM_FLAG_OPTIONS | PARAM_FLAG_UNKNOWN_OPTIONS | PARAM_FLAG_GETREST, @@ -137,11 +127,9 @@ static void cmd_wjoin_pre(const char *data, SERVER_REC *server) cmd_params_free(free_arg); return; } - arg = g_hash_table_lookup(optlist, "window"); - if (arg != NULL) { - int refnum = *arg != '\0' ? atoi(arg) : 0; - signal_add_data("channel created", - (SIGNAL_FUNC) signal_channel_created_curwin, GINT_TO_POINTER(refnum)); + if (g_hash_table_lookup(optlist, "window") != NULL) { + signal_add("channel created", + (SIGNAL_FUNC) signal_channel_created_curwin); } cmd_params_free(free_arg); } @@ -179,18 +167,15 @@ static void cmd_wjoin_post(const char *data) GHashTable *optlist; char *nick; void *free_arg; - char *arg; if (!cmd_get_params(data, &free_arg, 1 | PARAM_FLAG_OPTIONS | PARAM_FLAG_UNKNOWN_OPTIONS | PARAM_FLAG_GETREST, "join", &optlist, &nick)) return; - arg = g_hash_table_lookup(optlist, "window"); - if (arg != NULL) { - int refnum = *arg != '\0' ? atoi(arg) : 0; - signal_remove_data("channel created", - (SIGNAL_FUNC) signal_channel_created_curwin, GINT_TO_POINTER(refnum)); + if (g_hash_table_lookup(optlist, "window") != NULL) { + signal_remove("channel created", + (SIGNAL_FUNC) signal_channel_created_curwin); } cmd_params_free(free_arg); } @@ -665,7 +650,7 @@ void fe_channels_init(void) command_set_options("channel add", "auto noauto -bots -botcmd"); command_set_options("names", "count ops halfops voices normal"); - command_set_options("join", "@window"); + command_set_options("join", "window"); } void fe_channels_deinit(void) diff --git a/src/fe-common/core/fe-queries.c b/src/fe-common/core/fe-queries.c index 22d35719..991b9bb5 100644 --- a/src/fe-common/core/fe-queries.c +++ b/src/fe-common/core/fe-queries.c @@ -76,18 +76,9 @@ static void signal_query_created(QUERY_REC *query, gpointer automatic) static void signal_query_created_curwin(QUERY_REC *query) { - WINDOW_REC *window; - int refnum; - g_return_if_fail(IS_QUERY(query)); - window = NULL; - refnum = GPOINTER_TO_INT(signal_get_user_data()); - if (refnum > 0) - window = window_find_refnum(refnum); - if (window == NULL) - window = active_win; - window_item_add(window, (WI_ITEM_REC *) query, window != active_win); + window_item_add(active_win, (WI_ITEM_REC *) query, FALSE); } static void signal_query_destroyed(QUERY_REC *query) @@ -235,8 +226,6 @@ static void cmd_query(const char *data, SERVER_REC *server, WI_ITEM_REC *item) QUERY_REC *query; char *nick, *msg; void *free_arg; - char *arg; - int refnum; g_return_if_fail(data != NULL); @@ -261,11 +250,9 @@ static void cmd_query(const char *data, SERVER_REC *server, WI_ITEM_REC *item) if (*nick != '=' && (server == NULL || !server->connected)) cmd_param_error(CMDERR_NOT_CONNECTED); - arg = g_hash_table_lookup(optlist, "window"); - if (arg != NULL) { - refnum = *arg != '\0' ? atoi(arg) : 0; - signal_add_data("query created", - (SIGNAL_FUNC) signal_query_created_curwin, GINT_TO_POINTER(refnum)); + if (g_hash_table_lookup(optlist, "window") != NULL) { + signal_add("query created", + (SIGNAL_FUNC) signal_query_created_curwin); } query = query_find(server, nick); @@ -281,9 +268,9 @@ static void cmd_query(const char *data, SERVER_REC *server, WI_ITEM_REC *item) window_item_set_active(active_win, (WI_ITEM_REC *) query); } - if (arg != NULL) { - signal_remove_data("query created", - (SIGNAL_FUNC) signal_query_created_curwin, GINT_TO_POINTER(refnum)); + if (g_hash_table_lookup(optlist, "window") != NULL) { + signal_remove("query created", + (SIGNAL_FUNC) signal_query_created_curwin); } if (*msg != '\0') { @@ -386,7 +373,7 @@ void fe_queries_init(void) command_bind("unquery", NULL, (SIGNAL_FUNC) cmd_unquery); command_bind("window server", NULL, (SIGNAL_FUNC) cmd_window_server); - command_set_options("query", "@window"); + command_set_options("query", "window"); } void fe_queries_deinit(void) -- cgit v1.2.3