1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-11-03 19:37:16 -05:00

Allow pasing a jid to status command in chat window

Regards https://github.com/profanity-im/profanity/issues/1194
This commit is contained in:
Michael Vetter 2019-09-29 14:58:25 +02:00
parent 49b69c883f
commit 0f732466f8

View File

@ -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);