about summary refs log tree commit diff stats
path: root/src/command
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2015-04-21 23:35:37 +0100
committerJames Booth <boothj5@gmail.com>2015-04-21 23:35:37 +0100
commitbc445ccdfb0f8e210e793925e120b01bd0d9b918 (patch)
tree72c6fe466ed140cac3f04def74d88fdba20d54b4 /src/command
parentebca38e22483ec7054596a8ecf0bdccd85e76e0a (diff)
parent88739d5c59022b4d1f1b67da3128cb4a3266ecf9 (diff)
downloadprofani-tty-bc445ccdfb0f8e210e793925e120b01bd0d9b918.tar.gz
Merge branch 'master' into pgp
Diffstat (limited to 'src/command')
-rw-r--r--src/command/commands.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/src/command/commands.c b/src/command/commands.c
index d6750c68..8e657f30 100644
--- a/src/command/commands.c
+++ b/src/command/commands.c
@@ -749,7 +749,7 @@ gboolean
 cmd_win(gchar **args, struct cmd_help_t help)
 {
     int num = atoi(args[0]);
-    gboolean switched = ui_switch_win(num);
+    gboolean switched = ui_switch_win_num(num);
     if (switched == FALSE) {
         cons_show("Window %d does not exist.", num);
     }
@@ -1358,7 +1358,13 @@ cmd_msg(gchar **args, struct cmd_help_t help)
             client_send_msg(barejid, msg);
             return TRUE;
         } else {
-            ui_new_chat_win(barejid);
+            ProfWin *window = (ProfWin*)wins_get_chat(barejid);
+            if (window) {
+                client_focus_win(window);
+            } else {
+                client_new_chat_win(barejid);
+            }
+
 #ifdef HAVE_LIBOTR
             if (otr_is_secure(barejid)) {
                 ui_gone_secure(barejid, otr_is_trusted(barejid));
@@ -2478,7 +2484,7 @@ cmd_form(gchar **args, struct cmd_help_t help)
             current = wins_get_console();
         }
         int num = wins_get_num(current);
-        ui_switch_win(num);
+        ui_switch_win_num(num);
     }
 
     return TRUE;
@@ -2786,7 +2792,7 @@ cmd_room(gchar **args, struct cmd_help_t help)
 
         if (confwin != NULL) {
             num = wins_get_num(window);
-            ui_switch_win(num);
+            ui_switch_win_num(num);
         } else {
             iq_request_room_config_form(mucwin->roomjid);
         }
@@ -4246,7 +4252,12 @@ cmd_otr(gchar **args, struct cmd_help_t help)
                 barejid = contact;
             }
 
-            ui_new_chat_win(barejid);
+            ProfWin *window = (ProfWin*)wins_get_chat(barejid);
+            if (window) {
+                client_focus_win(window);
+            } else {
+                client_new_chat_win(barejid);
+            }
 
             if (ui_current_win_is_otr()) {
                 ui_current_print_formatted_line('!', 0, "You are already in an OTR session.");