mirror of
https://github.com/irssi/irssi.git
synced 2024-12-04 14:46:39 -05:00
Renamed /SET query_auto_close to autoclose_query.
Added /SET autocreate_own_query - it specifies if we want to create query window when we send /MSG to someone. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@343 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
627d288a49
commit
6140ab3704
@ -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");
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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();
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user