Skip to content

Commit

Permalink
Allow pasing a jid to status command in chat window
Browse files Browse the repository at this point in the history
Regards #1194
  • Loading branch information
jubalh committed Sep 29, 2019
1 parent 49b69c8 commit 0f73246
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/command/cmd_funcs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit 0f73246

Please sign in to comment.