mirror of
https://github.com/irssi/irssi.git
synced 2024-08-04 03:34:18 -04:00
/SET autocreate_query_level DCCMSGS specifies now if DCC chats should
create query windows automatically. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@842 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
3de1830008
commit
29a64a8924
@ -284,7 +284,7 @@ static void read_settings(void)
|
||||
|
||||
void fe_queries_init(void)
|
||||
{
|
||||
settings_add_str("lookandfeel", "autocreate_query_level", "MSGS");
|
||||
settings_add_str("lookandfeel", "autocreate_query_level", "MSGS DCCMSGS");
|
||||
settings_add_bool("lookandfeel", "autocreate_own_query", TRUE);
|
||||
settings_add_int("lookandfeel", "autoclose_query", 0);
|
||||
|
||||
|
@ -22,6 +22,7 @@
|
||||
#include "signals.h"
|
||||
#include "commands.h"
|
||||
#include "network.h"
|
||||
#include "settings.h"
|
||||
|
||||
#include "levels.h"
|
||||
#include "irc.h"
|
||||
@ -37,6 +38,8 @@
|
||||
#include "module-formats.h"
|
||||
#include "printtext.h"
|
||||
|
||||
static int autocreate_dccquery;
|
||||
|
||||
static void dcc_connected(DCC_REC *dcc)
|
||||
{
|
||||
char *sender;
|
||||
@ -48,7 +51,7 @@ static void dcc_connected(DCC_REC *dcc)
|
||||
sender = g_strconcat("=", dcc->nick, NULL);
|
||||
printformat(dcc->server, sender, MSGLEVEL_DCC, IRCTXT_DCC_CHAT_CONNECTED,
|
||||
dcc->nick, dcc->addrstr, dcc->port);
|
||||
if (query_find(NULL, sender) == NULL)
|
||||
if (autocreate_dccquery && query_find(NULL, sender) == NULL)
|
||||
irc_query_create(dcc->server, sender, TRUE);
|
||||
g_free(sender);
|
||||
break;
|
||||
@ -444,6 +447,14 @@ static void sig_dcc_send_complete(GList **list, WINDOW_REC *window,
|
||||
}
|
||||
}
|
||||
|
||||
static void read_settings(void)
|
||||
{
|
||||
int level;
|
||||
|
||||
level = level2bits(settings_get_str("autocreate_query_level"));
|
||||
autocreate_dccquery = (level & MSGLEVEL_DCCMSGS) != 0;
|
||||
}
|
||||
|
||||
void fe_irc_dcc_init(void)
|
||||
{
|
||||
signal_add("dcc connected", (SIGNAL_FUNC) dcc_connected);
|
||||
@ -465,6 +476,7 @@ void fe_irc_dcc_init(void)
|
||||
signal_add("dcc destroyed", (SIGNAL_FUNC) sig_dcc_destroyed);
|
||||
signal_add("query destroyed", (SIGNAL_FUNC) sig_query_destroyed);
|
||||
signal_add("complete command dcc send", (SIGNAL_FUNC) sig_dcc_send_complete);
|
||||
signal_add("setup changed", (SIGNAL_FUNC) read_settings);
|
||||
command_bind("msg", NULL, (SIGNAL_FUNC) cmd_msg);
|
||||
command_bind("me", NULL, (SIGNAL_FUNC) cmd_me);
|
||||
command_bind("action", NULL, (SIGNAL_FUNC) cmd_action);
|
||||
@ -473,6 +485,7 @@ void fe_irc_dcc_init(void)
|
||||
command_bind("dcc list", NULL, (SIGNAL_FUNC) cmd_dcc_list);
|
||||
|
||||
theme_register(fecommon_irc_dcc_formats);
|
||||
read_settings();
|
||||
}
|
||||
|
||||
void fe_irc_dcc_deinit(void)
|
||||
@ -498,6 +511,7 @@ void fe_irc_dcc_deinit(void)
|
||||
signal_remove("dcc destroyed", (SIGNAL_FUNC) sig_dcc_destroyed);
|
||||
signal_remove("query destroyed", (SIGNAL_FUNC) sig_query_destroyed);
|
||||
signal_remove("complete command dcc send", (SIGNAL_FUNC) sig_dcc_send_complete);
|
||||
signal_remove("setup changed", (SIGNAL_FUNC) read_settings);
|
||||
command_unbind("msg", (SIGNAL_FUNC) cmd_msg);
|
||||
command_unbind("me", (SIGNAL_FUNC) cmd_me);
|
||||
command_unbind("action", (SIGNAL_FUNC) cmd_action);
|
||||
|
Loading…
Reference in New Issue
Block a user