From e58be44f8185a0fbb43a3ee902acf21c89b158b6 Mon Sep 17 00:00:00 2001 From: James Booth Date: Sun, 17 Jan 2016 01:49:16 +0000 Subject: Added /roster room unread preference closes ##708 --- src/ui/console.c | 9 +++++++++ src/ui/rosterwin.c | 7 ++++++- 2 files changed, 15 insertions(+), 1 deletion(-) (limited to 'src/ui') diff --git a/src/ui/console.c b/src/ui/console.c index 42001960..4656b4e3 100644 --- a/src/ui/console.c +++ b/src/ui/console.c @@ -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); diff --git a/src/ui/rosterwin.c b/src/ui/rosterwin.c index 06ac4673..5b18ec95 100644 --- a/src/ui/rosterwin.c +++ b/src/ui/rosterwin.c @@ -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); -- cgit 1.4.1-2-gfad0