about summary refs log tree commit diff stats
path: root/src/command
diff options
context:
space:
mode:
authorMichael Vetter <jubalh@iodoru.org>2019-09-29 14:58:25 +0200
committerMichael Vetter <jubalh@iodoru.org>2019-09-29 14:58:25 +0200
commit0f732466f8979a592e4028a0e16799e653702fc2 (patch)
treee40829f3ab9543fc6b9b7f14e789d8f0046da17f /src/command
parent49b69c883f00bc4926df616f42268225d0185eab (diff)
downloadprofani-tty-0f732466f8979a592e4028a0e16799e653702fc2.tar.gz
Allow pasing a jid to status command in chat window
Regards https://github.com/profanity-im/profanity/issues/1194
Diffstat (limited to 'src/command')
-rw-r--r--src/command/cmd_funcs.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/command/cmd_funcs.c b/src/command/cmd_funcs.c
index eba9aa83..1a3cca40 100644
--- a/src/command/cmd_funcs.c
+++ b/src/command/cmd_funcs.c
@@ -3246,7 +3246,11 @@ cmd_status(ProfWin *window, const char *const command, gchar **args)
             break;
         case WIN_CHAT:
             if (usr) {
-                win_println(window, THEME_DEFAULT, '-', "No parameter required when in chat.");
+                char *usr_jid = roster_barejid_from_name(usr);
+                if (usr_jid == NULL) {
+                    usr_jid = usr;
+                }
+                cons_show_status(usr_jid);
             } else {
                 ProfChatWin *chatwin = (ProfChatWin*)window;
                 assert(chatwin->memcheck == PROFCHATWIN_MEMCHECK);
@@ -3260,7 +3264,11 @@ cmd_status(ProfWin *window, const char *const command, gchar **args)
             break;
         case WIN_PRIVATE:
             if (usr) {
-                win_println(window, THEME_DEFAULT, '-', "No parameter required when in chat.");
+                char *usr_jid = roster_barejid_from_name(usr);
+                if (usr_jid == NULL) {
+                    usr_jid = usr;
+                }
+                cons_show_status(usr_jid);
             } else {
                 ProfPrivateWin *privatewin = (ProfPrivateWin*)window;
                 assert(privatewin->memcheck == PROFPRIVATEWIN_MEMCHECK);