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:31:27 +0100
committerJames Booth <boothj5@gmail.com>2015-05-04 01:31:27 +0100
commitc8eaaa0ce918064a4009f706baac4a975999fc3f (patch)
tree6745a1b7c7c3cb05980a75f26ffa6465eefecb7c /src/command
parentb1dd1e2726892ac8152ba4b8f880f693c113a6e9 (diff)
downloadprofani-tty-c8eaaa0ce918064a4009f706baac4a975999fc3f.tar.gz
Added ui_ev_new_private_win to ui events
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 21acc413..dfabc4f0 100644
--- a/src/command/commands.c
+++ b/src/command/commands.c
@@ -116,7 +116,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:
@@ -1310,10 +1310,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);
@@ -3149,7 +3153,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: