mirror of
https://github.com/irssi/irssi.git
synced 2025-02-02 15:08:01 -05:00
/JOIN #channel and /QUERY nick won't anymore automatically move
channel/query to active window but send a notice to user how to move it. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1325 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
d4558de232
commit
f71afe835a
@ -131,14 +131,31 @@ static void cmd_wjoin_pre(const char *data)
|
||||
|
||||
static void cmd_join(const char *data, SERVER_REC *server)
|
||||
{
|
||||
WINDOW_REC *window;
|
||||
CHANNEL_REC *channel;
|
||||
|
||||
if (strchr(data, ' ') != NULL || strchr(data, ',') != NULL)
|
||||
return;
|
||||
|
||||
channel = channel_find(server, data);
|
||||
if (channel != NULL)
|
||||
window_item_set_active(active_win, (WI_ITEM_REC *) channel);
|
||||
if (channel == NULL)
|
||||
return;
|
||||
|
||||
window = window_item_window(channel);
|
||||
|
||||
if (window == active_win) {
|
||||
/* channel is in active window, set it active */
|
||||
window_item_set_active(active_win,
|
||||
(WI_ITEM_REC *) channel);
|
||||
} else {
|
||||
/* notify user how to move the channel to active
|
||||
window. this was used to be done automatically
|
||||
but it just confused everyone who did it
|
||||
accidentally */
|
||||
printformat_window(active_win, MSGLEVEL_CLIENTNOTICE,
|
||||
TXT_CHANNEL_MOVE_NOTIFY, channel->name,
|
||||
window->refnum);
|
||||
}
|
||||
}
|
||||
|
||||
static void cmd_wjoin_post(const char *data)
|
||||
|
@ -228,9 +228,22 @@ static void cmd_query(const char *data, SERVER_REC *server, WI_ITEM_REC *item)
|
||||
if (query == NULL)
|
||||
CHAT_PROTOCOL(server)->query_create(server->tag, nick, FALSE);
|
||||
else {
|
||||
/* query already existed - set query active / move it to this
|
||||
window */
|
||||
window_item_set_active(active_win, (WI_ITEM_REC *) query);
|
||||
/* query already exists */
|
||||
WINDOW_REC *window = window_item_window(query);
|
||||
|
||||
if (window == active_win) {
|
||||
/* query is in active window, set it active */
|
||||
window_item_set_active(active_win,
|
||||
(WI_ITEM_REC *) query);
|
||||
} else {
|
||||
/* notify user how to move the query to active
|
||||
window. this was used to be done automatically
|
||||
but it just confused everyone who did it
|
||||
accidentally */
|
||||
printformat_window(active_win, MSGLEVEL_CLIENTNOTICE,
|
||||
TXT_QUERY_MOVE_NOTIFY, query->name,
|
||||
window->refnum);
|
||||
}
|
||||
}
|
||||
|
||||
if (g_hash_table_lookup(optlist, "window") != NULL) {
|
||||
|
@ -94,6 +94,7 @@ FORMAT_REC fecommon_core_formats[] = {
|
||||
{ "chansetup_header", "Channel IRC net Password Settings", 0 },
|
||||
{ "chansetup_line", "{channel $[15]0} %|$[10]1 $[10]2 $3", 4, { 0, 0, 0, 0 } },
|
||||
{ "chansetup_footer", "", 0 },
|
||||
{ "channel_move_notify", "{channel $0} is already joined in window $1, use \"/WINDOW ITEM MOVE $0\" to move it to this window", 2, { 0, 1 } },
|
||||
|
||||
/* ---- */
|
||||
{ NULL, "Messages", 0 },
|
||||
@ -119,6 +120,7 @@ FORMAT_REC fecommon_core_formats[] = {
|
||||
{ "query_start", "Starting query with {nick $0}", 1, { 0 } },
|
||||
{ "no_query", "No query with {nick $0}", 1, { 0 } },
|
||||
{ "query_server_changed", "Query with {nick $0} changed to server {server $1}", 2, { 0, 0 } },
|
||||
{ "query_move_notify", "Query with {nick $0} is already created to window $1, use \"/WINDOW ITEM MOVE $0\" to move it to this window", 2, { 0, 1 } },
|
||||
|
||||
/* ---- */
|
||||
{ NULL, "Highlighting", 0 },
|
||||
|
@ -70,6 +70,7 @@ enum {
|
||||
TXT_CHANSETUP_HEADER,
|
||||
TXT_CHANSETUP_LINE,
|
||||
TXT_CHANSETUP_FOOTER,
|
||||
TXT_CHANNEL_MOVE_NOTIFY,
|
||||
|
||||
TXT_FILL_4,
|
||||
|
||||
@ -93,6 +94,7 @@ enum {
|
||||
TXT_QUERY_STARTED,
|
||||
TXT_NO_QUERY,
|
||||
TXT_QUERY_SERVER_CHANGED,
|
||||
TXT_QUERY_MOVE_NOTIFY,
|
||||
|
||||
TXT_FILL_6,
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user