Added /roster room unread preference

closes ##708
This commit is contained in:
James Booth
2016-01-17 01:49:16 +00:00
parent 56751e896b
commit e58be44f81
10 changed files with 68 additions and 1 deletions

View File

@@ -1341,6 +1341,15 @@ cons_roster_setting(void)
cons_show("Roster rooms order (/roster) : %s", rooms_order);
prefs_free_string(rooms_order);
char *roomsunread = prefs_get_string(PREF_ROSTER_ROOMS_UNREAD);
if (g_strcmp0(roomsunread, "before") == 0) {
cons_show("Roster rooms unread (/roster) : before");
} else if (g_strcmp0(roomsunread, "after") == 0) {
cons_show("Roster rooms unread (/roster) : after");
} else {
cons_show("Roster rooms unread (/roster) : OFF");
}
int size = prefs_get_roster_size();
cons_show("Roster size (/roster) : %d", size);

View File

@@ -483,10 +483,15 @@ _rosterwin_room(ProfLayoutSplit *layout, ProfMucWin *mucwin)
g_string_append_printf(msg, "%c", ch);
}
char *unreadpos = prefs_get_string(PREF_ROSTER_ROOMS_UNREAD);
if ((g_strcmp0(unreadpos, "before") == 0) && mucwin->unread > 0) {
g_string_append_printf(msg, "(%d) ", mucwin->unread);
}
g_string_append(msg, mucwin->roomjid);
if (mucwin->unread > 0) {
if ((g_strcmp0(unreadpos, "after") == 0) && mucwin->unread > 0) {
g_string_append_printf(msg, " (%d)", mucwin->unread);
}
prefs_free_string(unreadpos);
win_sub_newline_lazy(layout->subwin);
gboolean wrap = prefs_get_boolean(PREF_ROSTER_WRAP);