2001-08-23 06:54:54 -04:00
|
|
|
/*
|
2000-08-26 11:39:44 -04:00
|
|
|
fe-queries.c : irssi
|
2000-04-26 04:03:38 -04:00
|
|
|
|
|
|
|
Copyright (C) 1999-2000 Timo Sirainen
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
2007-05-08 14:41:10 -04:00
|
|
|
You should have received a copy of the GNU General Public License along
|
|
|
|
with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
2000-04-26 04:03:38 -04:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "module.h"
|
|
|
|
#include "module-formats.h"
|
|
|
|
#include "modules.h"
|
|
|
|
#include "signals.h"
|
|
|
|
#include "commands.h"
|
2001-02-17 14:44:22 -05:00
|
|
|
#include "levels.h"
|
2000-05-04 06:32:42 -04:00
|
|
|
#include "settings.h"
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2001-02-17 14:44:22 -05:00
|
|
|
#include "chat-protocols.h"
|
2001-12-19 21:14:49 -05:00
|
|
|
#include "servers.h"
|
2000-09-02 14:53:58 -04:00
|
|
|
#include "queries.h"
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2002-06-05 16:11:10 -04:00
|
|
|
#include "fe-core-commands.h"
|
2000-11-17 11:27:14 -05:00
|
|
|
#include "fe-windows.h"
|
2000-04-26 04:03:38 -04:00
|
|
|
#include "window-items.h"
|
2000-10-28 16:14:19 -04:00
|
|
|
#include "printtext.h"
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2000-09-06 17:30:56 -04:00
|
|
|
static int queryclose_tag, query_auto_close, querycreate_level;
|
2000-05-04 06:32:42 -04:00
|
|
|
|
2000-06-12 18:57:53 -04:00
|
|
|
/* Return query where to put the private message. */
|
2000-09-06 17:30:56 -04:00
|
|
|
QUERY_REC *privmsg_get_query(SERVER_REC *server, const char *nick,
|
|
|
|
int own, int level)
|
2000-06-12 18:57:53 -04:00
|
|
|
{
|
|
|
|
QUERY_REC *query;
|
|
|
|
|
2000-09-02 14:53:58 -04:00
|
|
|
g_return_val_if_fail(IS_SERVER(server), NULL);
|
|
|
|
g_return_val_if_fail(nick != NULL, NULL);
|
|
|
|
|
|
|
|
query = query_find(server, nick);
|
2002-06-05 16:11:10 -04:00
|
|
|
if (query == NULL && !command_hide_output &&
|
|
|
|
(querycreate_level & level) != 0 &&
|
2001-01-01 12:13:55 -05:00
|
|
|
(!own || settings_get_bool("autocreate_own_query"))) {
|
2001-02-17 14:44:22 -05:00
|
|
|
query = CHAT_PROTOCOL(server)->
|
|
|
|
query_create(server->tag, nick, TRUE);
|
2001-01-01 12:13:55 -05:00
|
|
|
}
|
2000-06-12 18:57:53 -04:00
|
|
|
|
|
|
|
return query;
|
|
|
|
}
|
|
|
|
|
2000-04-26 04:03:38 -04:00
|
|
|
static void signal_query_created(QUERY_REC *query, gpointer automatic)
|
|
|
|
{
|
2002-02-03 23:35:11 -05:00
|
|
|
TEXT_DEST_REC dest;
|
|
|
|
|
2000-12-16 21:20:22 -05:00
|
|
|
g_return_if_fail(IS_QUERY(query));
|
|
|
|
|
2001-03-03 16:57:31 -05:00
|
|
|
if (window_item_window(query) == NULL) {
|
|
|
|
window_item_create((WI_ITEM_REC *) query,
|
|
|
|
GPOINTER_TO_INT(automatic));
|
|
|
|
}
|
2001-07-28 21:41:01 -04:00
|
|
|
|
2002-02-03 23:35:11 -05:00
|
|
|
format_create_dest_tag(&dest, query->server, query->server_tag,
|
|
|
|
query->name, MSGLEVEL_CLIENTNOTICE, NULL);
|
|
|
|
printformat_dest(&dest, TXT_QUERY_START,
|
|
|
|
query->name, query->server_tag);
|
2000-04-26 04:03:38 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
static void signal_query_created_curwin(QUERY_REC *query)
|
|
|
|
{
|
2000-12-16 21:20:22 -05:00
|
|
|
g_return_if_fail(IS_QUERY(query));
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2007-06-16 10:58:13 -04:00
|
|
|
window_item_add(active_win, (WI_ITEM_REC *) query, FALSE);
|
2000-04-26 04:03:38 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
static void signal_query_destroyed(QUERY_REC *query)
|
|
|
|
{
|
|
|
|
WINDOW_REC *window;
|
2002-02-03 23:35:11 -05:00
|
|
|
TEXT_DEST_REC dest;
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2000-12-16 21:20:22 -05:00
|
|
|
g_return_if_fail(IS_QUERY(query));
|
2000-04-26 04:03:38 -04:00
|
|
|
|
|
|
|
window = window_item_window((WI_ITEM_REC *) query);
|
2002-02-03 23:35:11 -05:00
|
|
|
if (window == NULL)
|
|
|
|
return;
|
2001-07-28 21:41:01 -04:00
|
|
|
|
2002-02-03 23:35:11 -05:00
|
|
|
format_create_dest_tag(&dest, query->server, query->server_tag,
|
|
|
|
query->name, MSGLEVEL_CLIENTNOTICE, NULL);
|
|
|
|
printformat_dest(&dest, TXT_QUERY_STOP, query->name);
|
2000-06-17 08:22:56 -04:00
|
|
|
|
2002-02-03 23:35:11 -05:00
|
|
|
window_item_destroy((WI_ITEM_REC *) query);
|
|
|
|
|
|
|
|
if (!query->unwanted)
|
|
|
|
window_auto_destroy(window);
|
2002-04-27 17:09:39 -04:00
|
|
|
else {
|
|
|
|
/* eg. connection lost to dcc chat */
|
2002-05-10 14:32:50 -04:00
|
|
|
window_bind_add(window, query->server_tag, query->name);
|
2002-04-27 17:09:39 -04:00
|
|
|
}
|
2000-04-26 04:03:38 -04:00
|
|
|
}
|
|
|
|
|
2000-12-16 21:20:22 -05:00
|
|
|
static void signal_query_server_changed(QUERY_REC *query)
|
|
|
|
{
|
|
|
|
WINDOW_REC *window;
|
|
|
|
|
|
|
|
g_return_if_fail(query != NULL);
|
|
|
|
|
|
|
|
window = window_item_window((WI_ITEM_REC *) query);
|
|
|
|
if (window->active == (WI_ITEM_REC *) query)
|
|
|
|
window_change_server(window, query->server);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void signal_query_nick_changed(QUERY_REC *query, const char *oldnick)
|
|
|
|
{
|
2002-02-03 23:35:11 -05:00
|
|
|
TEXT_DEST_REC dest;
|
|
|
|
|
2000-12-16 21:20:22 -05:00
|
|
|
g_return_if_fail(query != NULL);
|
|
|
|
|
2002-02-03 23:35:11 -05:00
|
|
|
format_create_dest_tag(&dest, query->server, query->server_tag,
|
2007-06-16 11:02:17 -04:00
|
|
|
query->name, MSGLEVEL_NICKS, NULL);
|
2002-03-12 22:15:39 -05:00
|
|
|
|
|
|
|
/* don't print the nick change message if only the case was changed */
|
2014-06-10 12:06:19 -04:00
|
|
|
if (g_ascii_strcasecmp(query->name, oldnick) != 0) {
|
2002-03-12 22:15:39 -05:00
|
|
|
printformat_dest(&dest, TXT_NICK_CHANGED, oldnick,
|
2002-04-28 20:11:18 -04:00
|
|
|
query->name, query->name,
|
|
|
|
query->address == NULL ? "" : query->address);
|
2002-03-12 22:15:39 -05:00
|
|
|
}
|
2001-06-10 19:31:15 -04:00
|
|
|
|
2000-12-16 21:20:22 -05:00
|
|
|
signal_emit("window item changed", 2,
|
|
|
|
window_item_window((WI_ITEM_REC *) query), query);
|
|
|
|
}
|
|
|
|
|
2001-01-01 12:13:55 -05:00
|
|
|
static void signal_window_item_server_changed(WINDOW_REC *window,
|
|
|
|
QUERY_REC *query)
|
|
|
|
{
|
|
|
|
if (IS_QUERY(query)) {
|
|
|
|
g_free_and_null(query->server_tag);
|
|
|
|
if (query->server != NULL)
|
|
|
|
query->server_tag = g_strdup(query->server->tag);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2000-09-02 14:53:58 -04:00
|
|
|
static void sig_server_connected(SERVER_REC *server)
|
2000-04-26 04:03:38 -04:00
|
|
|
{
|
|
|
|
GSList *tmp;
|
|
|
|
|
2000-09-02 14:53:58 -04:00
|
|
|
if (!IS_SERVER(server))
|
2000-04-26 04:03:38 -04:00
|
|
|
return;
|
|
|
|
|
|
|
|
/* check if there's any queries without server */
|
|
|
|
for (tmp = queries; tmp != NULL; tmp = tmp->next) {
|
|
|
|
QUERY_REC *rec = tmp->data;
|
|
|
|
|
|
|
|
if (rec->server == NULL &&
|
2001-01-01 12:13:55 -05:00
|
|
|
(rec->server_tag == NULL ||
|
2014-06-10 12:06:19 -04:00
|
|
|
g_ascii_strcasecmp(rec->server_tag, server->tag) == 0)) {
|
2000-04-26 04:03:38 -04:00
|
|
|
window_item_change_server((WI_ITEM_REC *) rec, server);
|
|
|
|
server->queries = g_slist_append(server->queries, rec);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void cmd_window_server(const char *data)
|
|
|
|
{
|
|
|
|
SERVER_REC *server;
|
2000-12-16 21:20:22 -05:00
|
|
|
QUERY_REC *query;
|
2002-02-03 23:35:11 -05:00
|
|
|
TEXT_DEST_REC dest;
|
2000-04-26 04:03:38 -04:00
|
|
|
|
|
|
|
g_return_if_fail(data != NULL);
|
|
|
|
|
|
|
|
server = server_find_tag(data);
|
2000-12-16 21:20:22 -05:00
|
|
|
query = QUERY(active_win->active);
|
|
|
|
if (server == NULL || query == NULL)
|
2000-09-02 14:53:58 -04:00
|
|
|
return;
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2000-09-02 14:53:58 -04:00
|
|
|
/* /WINDOW SERVER used in a query window */
|
2002-02-03 23:35:11 -05:00
|
|
|
format_create_dest_tag(&dest, query->server, query->server_tag,
|
|
|
|
query->name, MSGLEVEL_CLIENTNOTICE, NULL);
|
|
|
|
printformat_dest(&dest, TXT_QUERY_SERVER_CHANGED,
|
|
|
|
query->name, server->tag);
|
|
|
|
|
2000-12-16 21:20:22 -05:00
|
|
|
query_change_server(query, server);
|
2000-09-02 14:53:58 -04:00
|
|
|
signal_stop();
|
2000-04-26 04:03:38 -04:00
|
|
|
}
|
|
|
|
|
2000-08-12 18:58:16 -04:00
|
|
|
/* SYNTAX: UNQUERY [<nick>] */
|
2000-09-02 14:53:58 -04:00
|
|
|
static void cmd_unquery(const char *data, SERVER_REC *server, WI_ITEM_REC *item)
|
2000-04-26 04:03:38 -04:00
|
|
|
{
|
2000-08-12 18:58:16 -04:00
|
|
|
QUERY_REC *query;
|
2002-10-14 07:39:36 -04:00
|
|
|
char *nick;
|
|
|
|
void *free_arg;
|
2000-08-11 22:16:52 -04:00
|
|
|
|
2000-08-12 18:58:16 -04:00
|
|
|
g_return_if_fail(data != NULL);
|
2000-08-11 22:16:52 -04:00
|
|
|
|
2002-10-14 07:39:36 -04:00
|
|
|
if (!cmd_get_params(data, &free_arg, 1, &nick))
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (*nick == '\0') {
|
2000-08-12 18:58:16 -04:00
|
|
|
/* remove current query */
|
2000-09-02 14:53:58 -04:00
|
|
|
query = QUERY(item);
|
2000-08-12 18:58:16 -04:00
|
|
|
} else {
|
2002-10-14 07:39:36 -04:00
|
|
|
query = query_find(server, nick);
|
2000-08-12 18:58:16 -04:00
|
|
|
if (query == NULL) {
|
2000-09-02 14:53:58 -04:00
|
|
|
printformat(server, NULL, MSGLEVEL_CLIENTERROR,
|
2002-10-14 07:39:36 -04:00
|
|
|
TXT_NO_QUERY, nick);
|
2000-08-12 18:58:16 -04:00
|
|
|
}
|
2000-08-11 22:16:52 -04:00
|
|
|
}
|
2000-08-12 18:58:16 -04:00
|
|
|
|
2002-10-14 07:39:36 -04:00
|
|
|
if (query != NULL)
|
|
|
|
query_destroy(query);
|
|
|
|
|
|
|
|
cmd_params_free(free_arg);
|
2000-08-11 22:16:52 -04:00
|
|
|
}
|
|
|
|
|
2001-03-07 19:45:56 -05:00
|
|
|
/* SYNTAX: QUERY [-window] [-<server tag>] <nick> [<message>] */
|
2000-09-02 14:53:58 -04:00
|
|
|
static void cmd_query(const char *data, SERVER_REC *server, WI_ITEM_REC *item)
|
2000-08-11 22:16:52 -04:00
|
|
|
{
|
|
|
|
GHashTable *optlist;
|
2000-08-12 18:58:16 -04:00
|
|
|
QUERY_REC *query;
|
2001-03-07 19:45:56 -05:00
|
|
|
char *nick, *msg;
|
2000-08-11 22:16:52 -04:00
|
|
|
void *free_arg;
|
|
|
|
|
2000-08-12 18:58:16 -04:00
|
|
|
g_return_if_fail(data != NULL);
|
|
|
|
|
2001-03-07 19:45:56 -05:00
|
|
|
if (!cmd_get_params(data, &free_arg, 2 | PARAM_FLAG_GETREST |
|
|
|
|
PARAM_FLAG_OPTIONS | PARAM_FLAG_UNKNOWN_OPTIONS,
|
|
|
|
"query", &optlist, &nick, &msg))
|
2000-08-11 22:16:52 -04:00
|
|
|
return;
|
2002-10-06 12:20:42 -04:00
|
|
|
|
|
|
|
if (*nick == '\0') {
|
|
|
|
/* remove current query */
|
|
|
|
cmd_unquery("", server, item);
|
|
|
|
cmd_params_free(free_arg);
|
|
|
|
return;
|
|
|
|
}
|
2000-09-02 14:53:58 -04:00
|
|
|
|
|
|
|
server = cmd_options_get_server("query", optlist, server);
|
2000-08-12 18:58:16 -04:00
|
|
|
if (server == NULL) {
|
|
|
|
cmd_params_free(free_arg);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (*nick != '=' && (server == NULL || !server->connected))
|
|
|
|
cmd_param_error(CMDERR_NOT_CONNECTED);
|
|
|
|
|
2007-06-16 10:58:13 -04:00
|
|
|
if (g_hash_table_lookup(optlist, "window") != NULL) {
|
|
|
|
signal_add("query created",
|
|
|
|
(SIGNAL_FUNC) signal_query_created_curwin);
|
2000-08-12 18:58:16 -04:00
|
|
|
}
|
|
|
|
|
2000-09-02 14:53:58 -04:00
|
|
|
query = query_find(server, nick);
|
2000-08-12 18:58:16 -04:00
|
|
|
if (query == NULL)
|
2002-02-03 16:53:37 -05:00
|
|
|
query = CHAT_PROTOCOL(server)->
|
|
|
|
query_create(server->tag, nick, FALSE);
|
2000-08-12 18:58:16 -04:00
|
|
|
else {
|
2002-04-17 17:04:25 -04:00
|
|
|
/* query already exists, set it active */
|
2001-03-03 16:51:57 -05:00
|
|
|
WINDOW_REC *window = window_item_window(query);
|
|
|
|
|
2002-04-17 17:04:25 -04:00
|
|
|
if (window != active_win)
|
|
|
|
window_set_active(window);
|
|
|
|
window_item_set_active(active_win, (WI_ITEM_REC *) query);
|
2000-08-12 18:58:16 -04:00
|
|
|
}
|
2000-08-11 22:16:52 -04:00
|
|
|
|
2007-06-16 10:58:13 -04:00
|
|
|
if (g_hash_table_lookup(optlist, "window") != NULL) {
|
|
|
|
signal_remove("query created",
|
|
|
|
(SIGNAL_FUNC) signal_query_created_curwin);
|
2000-08-11 22:16:52 -04:00
|
|
|
}
|
2000-08-12 18:58:16 -04:00
|
|
|
|
2001-03-07 19:45:56 -05:00
|
|
|
if (*msg != '\0') {
|
2002-02-03 16:53:37 -05:00
|
|
|
msg = g_strdup_printf("-nick %s %s", nick, msg);
|
|
|
|
signal_emit("command msg", 3, msg, server, query);
|
|
|
|
g_free(msg);
|
2001-03-07 19:45:56 -05:00
|
|
|
}
|
|
|
|
|
2000-08-11 22:16:52 -04:00
|
|
|
cmd_params_free(free_arg);
|
2000-04-26 04:03:38 -04:00
|
|
|
}
|
|
|
|
|
2002-03-10 09:24:08 -05:00
|
|
|
static void window_reset_query_timestamps(WINDOW_REC *window)
|
2000-05-04 06:32:42 -04:00
|
|
|
{
|
|
|
|
GSList *tmp;
|
|
|
|
|
2002-03-10 09:24:08 -05:00
|
|
|
if (window == NULL)
|
|
|
|
return;
|
2000-06-15 14:33:08 -04:00
|
|
|
|
2000-05-04 06:32:42 -04:00
|
|
|
for (tmp = window->items; tmp != NULL; tmp = tmp->next) {
|
2002-03-10 09:24:08 -05:00
|
|
|
QUERY_REC *query = QUERY(tmp->data);
|
2000-06-14 13:41:45 -04:00
|
|
|
|
2002-03-10 09:24:08 -05:00
|
|
|
if (query != NULL)
|
|
|
|
query->last_unread_msg = time(NULL);
|
|
|
|
}
|
2000-06-14 13:41:45 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
static void sig_window_changed(WINDOW_REC *window, WINDOW_REC *old_window)
|
|
|
|
{
|
2002-03-10 09:24:08 -05:00
|
|
|
/* reset the queries last_unread_msg so query doesn't get closed
|
|
|
|
immediately after switched to the window, or after changed to
|
|
|
|
some other window from it */
|
|
|
|
window_reset_query_timestamps(window);
|
|
|
|
window_reset_query_timestamps(old_window);
|
2000-05-04 06:32:42 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
static int sig_query_autoclose(void)
|
|
|
|
{
|
|
|
|
WINDOW_REC *window;
|
|
|
|
GSList *tmp, *next;
|
|
|
|
time_t now;
|
|
|
|
|
|
|
|
now = time(NULL);
|
|
|
|
for (tmp = queries; tmp != NULL; tmp = next) {
|
|
|
|
QUERY_REC *rec = tmp->data;
|
|
|
|
|
|
|
|
next = tmp->next;
|
|
|
|
window = window_item_window((WI_ITEM_REC *) rec);
|
2002-03-10 09:24:08 -05:00
|
|
|
if (window != active_win && rec->data_level < DATA_LEVEL_MSG &&
|
|
|
|
now-rec->last_unread_msg > query_auto_close)
|
2000-06-17 08:22:56 -04:00
|
|
|
query_destroy(rec);
|
2000-05-04 06:32:42 -04:00
|
|
|
}
|
2004-08-19 20:03:40 -04:00
|
|
|
return 1;
|
2000-05-04 06:32:42 -04:00
|
|
|
}
|
|
|
|
|
2000-10-01 21:04:39 -04:00
|
|
|
static void sig_message_private(SERVER_REC *server, const char *msg,
|
2014-10-25 23:12:30 -04:00
|
|
|
const char *nick, const char *address, const char *target)
|
2000-10-01 21:04:39 -04:00
|
|
|
{
|
2002-03-10 09:24:08 -05:00
|
|
|
QUERY_REC *query;
|
|
|
|
|
2014-10-25 23:12:30 -04:00
|
|
|
/* own message returned by bouncer? */
|
2015-04-07 21:39:05 -04:00
|
|
|
int own = (!g_strcmp0(nick, server->nick));
|
2014-10-25 23:12:30 -04:00
|
|
|
|
2000-10-01 21:04:39 -04:00
|
|
|
/* create query window if needed */
|
2014-10-25 23:12:30 -04:00
|
|
|
query = privmsg_get_query(server, own ? target : nick, FALSE, MSGLEVEL_MSGS);
|
2002-03-10 09:24:08 -05:00
|
|
|
|
|
|
|
/* reset the query's last_unread_msg timestamp */
|
2002-03-10 14:40:06 -05:00
|
|
|
if (query != NULL)
|
|
|
|
query->last_unread_msg = time(NULL);
|
2000-10-01 21:04:39 -04:00
|
|
|
}
|
|
|
|
|
2000-05-04 06:32:42 -04:00
|
|
|
static void read_settings(void)
|
|
|
|
{
|
2002-12-28 12:54:13 -05:00
|
|
|
querycreate_level = settings_get_level("autocreate_query_level");
|
|
|
|
query_auto_close = settings_get_time("autoclose_query")/1000;
|
2000-05-04 06:32:42 -04:00
|
|
|
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) {
|
|
|
|
g_source_remove(queryclose_tag);
|
|
|
|
queryclose_tag = -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2000-09-02 14:53:58 -04:00
|
|
|
void fe_queries_init(void)
|
2000-04-26 04:03:38 -04:00
|
|
|
{
|
2002-12-28 12:54:13 -05:00
|
|
|
settings_add_level("lookandfeel", "autocreate_query_level", "MSGS DCCMSGS");
|
2000-06-14 15:05:51 -04:00
|
|
|
settings_add_bool("lookandfeel", "autocreate_own_query", TRUE);
|
2002-12-28 12:54:13 -05:00
|
|
|
settings_add_time("lookandfeel", "autoclose_query", "0");
|
2000-05-04 06:32:42 -04:00
|
|
|
|
|
|
|
queryclose_tag = -1;
|
|
|
|
read_settings();
|
|
|
|
|
2000-04-26 04:03:38 -04:00
|
|
|
signal_add("query created", (SIGNAL_FUNC) signal_query_created);
|
|
|
|
signal_add("query destroyed", (SIGNAL_FUNC) signal_query_destroyed);
|
2000-12-16 21:20:22 -05:00
|
|
|
signal_add("query server changed", (SIGNAL_FUNC) signal_query_server_changed);
|
|
|
|
signal_add("query nick changed", (SIGNAL_FUNC) signal_query_nick_changed);
|
2001-01-01 12:13:55 -05:00
|
|
|
signal_add("window item server changed", (SIGNAL_FUNC) signal_window_item_server_changed);
|
2000-04-26 04:03:38 -04:00
|
|
|
signal_add("server connected", (SIGNAL_FUNC) sig_server_connected);
|
2000-05-04 06:32:42 -04:00
|
|
|
signal_add("window changed", (SIGNAL_FUNC) sig_window_changed);
|
2000-10-01 21:04:39 -04:00
|
|
|
signal_add_first("message private", (SIGNAL_FUNC) sig_message_private);
|
2000-05-04 06:32:42 -04:00
|
|
|
signal_add("setup changed", (SIGNAL_FUNC) read_settings);
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2000-08-12 18:58:16 -04:00
|
|
|
command_bind("query", NULL, (SIGNAL_FUNC) cmd_query);
|
|
|
|
command_bind("unquery", NULL, (SIGNAL_FUNC) cmd_unquery);
|
2000-04-26 04:03:38 -04:00
|
|
|
command_bind("window server", NULL, (SIGNAL_FUNC) cmd_window_server);
|
2000-08-11 22:16:52 -04:00
|
|
|
|
2007-06-16 10:58:13 -04:00
|
|
|
command_set_options("query", "window");
|
2000-04-26 04:03:38 -04:00
|
|
|
}
|
|
|
|
|
2000-09-02 14:53:58 -04:00
|
|
|
void fe_queries_deinit(void)
|
2000-04-26 04:03:38 -04:00
|
|
|
{
|
2000-05-04 06:32:42 -04:00
|
|
|
if (queryclose_tag != -1) g_source_remove(queryclose_tag);
|
|
|
|
|
2000-04-26 04:03:38 -04:00
|
|
|
signal_remove("query created", (SIGNAL_FUNC) signal_query_created);
|
|
|
|
signal_remove("query destroyed", (SIGNAL_FUNC) signal_query_destroyed);
|
2000-12-16 21:20:22 -05:00
|
|
|
signal_remove("query server changed", (SIGNAL_FUNC) signal_query_server_changed);
|
|
|
|
signal_remove("query nick changed", (SIGNAL_FUNC) signal_query_nick_changed);
|
2001-01-01 12:13:55 -05:00
|
|
|
signal_remove("window item server changed", (SIGNAL_FUNC) signal_window_item_server_changed);
|
2000-04-26 04:03:38 -04:00
|
|
|
signal_remove("server connected", (SIGNAL_FUNC) sig_server_connected);
|
2000-05-04 06:32:42 -04:00
|
|
|
signal_remove("window changed", (SIGNAL_FUNC) sig_window_changed);
|
2000-10-01 21:04:39 -04:00
|
|
|
signal_remove("message private", (SIGNAL_FUNC) sig_message_private);
|
2000-05-04 06:32:42 -04:00
|
|
|
signal_remove("setup changed", (SIGNAL_FUNC) read_settings);
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2000-08-12 18:58:16 -04:00
|
|
|
command_unbind("query", (SIGNAL_FUNC) cmd_query);
|
|
|
|
command_unbind("unquery", (SIGNAL_FUNC) cmd_unquery);
|
2000-04-26 04:03:38 -04:00
|
|
|
command_unbind("window server", (SIGNAL_FUNC) cmd_window_server);
|
|
|
|
}
|