Skip to content

Commit

Permalink
Fix statusbar display of active tab
Browse files Browse the repository at this point in the history
When using `/statusbar tabmode actlist` and `/statusbar self user` then we get `[00:23] [user]` and now `[00:23] [1:user]` where `1` is the active tab. The active tab is only displayed with fulljid.

This commit fixes 7d290b0.

Fix #1980
  • Loading branch information
jubalh committed Jun 19, 2024
1 parent c32aac7 commit ebcb198
Showing 1 changed file with 10 additions and 27 deletions.
37 changes: 10 additions & 27 deletions src/ui/statusbar.c
Original file line number Diff line number Diff line change
Expand Up @@ -549,37 +549,20 @@ _status_bar_draw_maintext(int pos)
return pos;
}

if (statusbar->fulljid) {
jidp = jid_create(statusbar->fulljid);
if (g_strcmp0(self, "user") == 0) {
maintext = jidp->localpart;
} else if (g_strcmp0(self, "barejid") == 0) {
maintext = jidp->barejid;
} else {
maintext = statusbar->fulljid;
}
}

if (maintext == NULL) {
if (statusbar->fulljid == NULL) {
return pos;
}

if (statusbar->fulljid) {
if (g_strcmp0(self, "off") == 0) {
return pos;
}
if (g_strcmp0(self, "user") == 0) {
auto_jid Jid* jidp = jid_create(statusbar->fulljid);
mvwprintw(statusbar_win, 0, pos, "%s", jidp->localpart);
return pos;
}
if (g_strcmp0(self, "barejid") == 0) {
auto_jid Jid* jidp = jid_create(statusbar->fulljid);
mvwprintw(statusbar_win, 0, pos, "%s", jidp->barejid);
return pos;
}
jidp = jid_create(statusbar->fulljid);
if (!jidp)
return pos;

mvwprintw(statusbar_win, 0, pos, "%s", statusbar->fulljid);
if (g_strcmp0(self, "user") == 0) {
maintext = jidp->localpart;
} else if (g_strcmp0(self, "barejid") == 0) {
maintext = jidp->barejid;
} else {
maintext = statusbar->fulljid;
}

gboolean actlist_tabmode = _tabmode_is_actlist();
Expand Down

0 comments on commit ebcb198

Please sign in to comment.