1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-12-04 14:46:46 -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; break;
case WIN_CHAT: case WIN_CHAT:
if (usr) { 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 { } else {
ProfChatWin *chatwin = (ProfChatWin*)window; ProfChatWin *chatwin = (ProfChatWin*)window;
assert(chatwin->memcheck == PROFCHATWIN_MEMCHECK); assert(chatwin->memcheck == PROFCHATWIN_MEMCHECK);
@ -3260,7 +3264,11 @@ cmd_status(ProfWin *window, const char *const command, gchar **args)
break; break;
case WIN_PRIVATE: case WIN_PRIVATE:
if (usr) { 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 { } else {
ProfPrivateWin *privatewin = (ProfPrivateWin*)window; ProfPrivateWin *privatewin = (ProfPrivateWin*)window;
assert(privatewin->memcheck == PROFPRIVATEWIN_MEMCHECK); assert(privatewin->memcheck == PROFPRIVATEWIN_MEMCHECK);