From 0f732466f8979a592e4028a0e16799e653702fc2 Mon Sep 17 00:00:00 2001 From: Michael Vetter Date: Sun, 29 Sep 2019 14:58:25 +0200 Subject: [PATCH] Allow pasing a jid to status command in chat window Regards https://github.com/profanity-im/profanity/issues/1194 --- src/command/cmd_funcs.c | 12 ++++++++++-- 1 file 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);