about summary refs log tree commit diff stats
path: root/src/ui/rosterwin.c
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2016-01-17 01:49:16 +0000
committerJames Booth <boothj5@gmail.com>2016-01-17 01:49:16 +0000
commite58be44f8185a0fbb43a3ee902acf21c89b158b6 (patch)
treee346d021c16caa12b2b7bed645926ad4f3adfbad /src/ui/rosterwin.c
parent56751e896bf60e1305d99ed9f827279ac9cc25d3 (diff)
downloadprofani-tty-e58be44f8185a0fbb43a3ee902acf21c89b158b6.tar.gz
Added /roster room unread preference
closes ##708
Diffstat (limited to 'src/ui/rosterwin.c')
-rw-r--r--src/ui/rosterwin.c7
1 files changed, 6 insertions, 1 deletions
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);