diff options
author | Timo Sirainen <cras@irssi.org> | 2000-09-02 18:53:58 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2000-09-02 18:53:58 +0000 |
commit | 755a8d40eb5f9e0a12b98e4f84332891a3d63b1a (patch) | |
tree | b96a317a11affdb428a121176836cf48e707c286 /src/irc/core/irc-queries.c | |
parent | 28a7908e7372fe0e81dd439b6559bc2abe3ea6e8 (diff) | |
download | irssi-755a8d40eb5f9e0a12b98e4f84332891a3d63b1a.zip |
Updates.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@641 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/irc/core/irc-queries.c')
-rw-r--r-- | src/irc/core/irc-queries.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/irc/core/irc-queries.c b/src/irc/core/irc-queries.c index d2dfee1c..6d16a030 100644 --- a/src/irc/core/irc-queries.c +++ b/src/irc/core/irc-queries.c @@ -41,6 +41,21 @@ QUERY_REC *irc_query_create(IRC_SERVER_REC *server, return rec; } +static void sig_query_create(QUERY_REC **query, + void *chat_type, IRC_SERVER_REC *server, + const char *nick, void *automatic) +{ + if (chat_protocol_lookup("IRC") != GPOINTER_TO_INT(chat_type)) + return; + + g_return_if_fail(server == NULL || IS_IRC_SERVER(server)); + g_return_if_fail(query != NULL); + g_return_if_fail(nick != NULL); + + *query = irc_query_create(server, nick, GPOINTER_TO_INT(automatic)); + signal_stop(); +} + static void event_privmsg(const char *data, IRC_SERVER_REC *server, const char *nick, const char *addr) { char *params, *target, *msg; @@ -86,12 +101,14 @@ static void event_nick(const char *data, IRC_SERVER_REC *server, const char *ori void irc_queries_init(void) { + signal_add("query create", (SIGNAL_FUNC) sig_query_create); signal_add_last("event privmsg", (SIGNAL_FUNC) event_privmsg); signal_add("event nick", (SIGNAL_FUNC) event_nick); } void irc_queries_deinit(void) { + signal_remove("query create", (SIGNAL_FUNC) sig_query_create); signal_remove("event privmsg", (SIGNAL_FUNC) event_privmsg); signal_remove("event nick", (SIGNAL_FUNC) event_nick); } |