1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-09-22 19:45:54 -04:00

Fix statusbar display of active tab

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 7d290b04d.

Fix https://github.com/profanity-im/profanity/issues/1980
This commit is contained in:
Michael Vetter 2024-06-19 13:04:09 +02:00
parent c32aac7644
commit ebcb198f09

View File

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