about summary refs log tree commit diff stats
path: root/src/command
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2015-05-04 01:34:18 +0100
committerJames Booth <boothj5@gmail.com>2015-05-04 01:34:18 +0100
commitaca102f542c53a16b32eaf68c4ee8ff07433eda0 (patch)
tree36d5ccc120540fc91631e70a2cd74f699daab20c /src/command
parent3dace733d982fdb33670f9a919cd9f46661d7088 (diff)
parentc8eaaa0ce918064a4009f706baac4a975999fc3f (diff)
downloadprofani-tty-aca102f542c53a16b32eaf68c4ee8ff07433eda0.tar.gz
Merge branch 'master' into pgp
Diffstat (limited to 'src/command')
-rw-r--r--src/command/commands.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/command/commands.c b/src/command/commands.c
index 4c868d77..a7e89724 100644
--- a/src/command/commands.c
+++ b/src/command/commands.c
@@ -119,7 +119,7 @@ cmd_execute_default(const char * inp)
     case WIN_PRIVATE:
     {
         ProfPrivateWin *privatewin = wins_get_current_private();
-        cl_ev_send_priv_msg(privatewin->fulljid, inp);
+        cl_ev_send_priv_msg(privatewin, inp);
         break;
     }
     case WIN_MUC:
@@ -1321,10 +1321,14 @@ cmd_msg(gchar **args, struct cmd_help_t help)
             g_string_append(full_jid, "/");
             g_string_append(full_jid, usr);
 
+            ProfPrivateWin *privwin = wins_get_private(full_jid->str);
+            if (!privwin) {
+                privwin = ui_ev_new_private_win(full_jid->str);
+            }
+            ui_ev_focus_win((ProfWin*)privwin);
+
             if (msg) {
-                cl_ev_send_priv_msg(full_jid->str, msg);
-            } else {
-                ui_new_private_win(full_jid->str);
+                cl_ev_send_priv_msg(privwin, msg);
             }
 
             g_string_free(full_jid, TRUE);
@@ -3160,7 +3164,7 @@ cmd_tiny(gchar **args, struct cmd_help_t help)
     case WIN_PRIVATE:
     {
         ProfPrivateWin *privatewin = wins_get_current_private();
-        cl_ev_send_priv_msg(privatewin->fulljid, tiny);
+        cl_ev_send_priv_msg(privatewin, tiny);
         break;
     }
     case WIN_MUC: