mirror of
https://github.com/profanity-im/profanity.git
synced 2025-01-03 14:57:42 -05:00
Only add private chats to Rooms unread count in roster when room active
This commit is contained in:
parent
1c65c36cb6
commit
a0f43adf5b
@ -843,21 +843,24 @@ _rosterwin_rooms_header(ProfLayoutSplit *layout, gboolean newline, GList *rooms)
|
|||||||
while (curr) {
|
while (curr) {
|
||||||
ProfMucWin *mucwin = curr->data;
|
ProfMucWin *mucwin = curr->data;
|
||||||
unread += mucwin->unread;
|
unread += mucwin->unread;
|
||||||
|
|
||||||
|
// include private chats
|
||||||
|
char *prefpriv = prefs_get_string(PREF_ROSTER_PRIVATE);
|
||||||
|
if (g_strcmp0(prefpriv, "room") == 0) {
|
||||||
|
GList *privwins = wins_get_private_chats(mucwin->roomjid);
|
||||||
|
GList *curr_priv = privwins;
|
||||||
|
while (curr_priv) {
|
||||||
|
ProfPrivateWin *privwin = curr_priv->data;
|
||||||
|
unread += privwin->unread;
|
||||||
|
curr_priv = g_list_next(curr_priv);
|
||||||
|
}
|
||||||
|
g_list_free(privwins);
|
||||||
|
}
|
||||||
|
prefs_free_string(prefpriv);
|
||||||
|
|
||||||
curr = g_list_next(curr);
|
curr = g_list_next(curr);
|
||||||
}
|
}
|
||||||
|
|
||||||
char *prefpriv = prefs_get_string(PREF_ROSTER_PRIVATE);
|
|
||||||
if (g_strcmp0(prefpriv, "room") == 0) {
|
|
||||||
GList *privwins = wins_get_private_chats(NULL);
|
|
||||||
GList *curr = privwins;
|
|
||||||
while (curr) {
|
|
||||||
ProfPrivateWin *privwin = curr->data;
|
|
||||||
unread += privwin->unread;
|
|
||||||
curr = g_list_next(curr);
|
|
||||||
}
|
|
||||||
g_list_free(privwins);
|
|
||||||
}
|
|
||||||
prefs_free_string(prefpriv);
|
|
||||||
if (unread == 0 && prefs_get_boolean(PREF_ROSTER_COUNT_ZERO)) {
|
if (unread == 0 && prefs_get_boolean(PREF_ROSTER_COUNT_ZERO)) {
|
||||||
g_string_append_printf(header, " (%d)", unread);
|
g_string_append_printf(header, " (%d)", unread);
|
||||||
} else if (unread > 0) {
|
} else if (unread > 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user