about summary refs log tree commit diff stats
path: root/src/command/commands.c
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2016-01-17 02:17:12 +0000
committerJames Booth <boothj5@gmail.com>2016-01-17 02:17:12 +0000
commitcce01f1d75a43b943237a11f9695e8426425210a (patch)
tree1914184d93bfe801aa3dea3f16ea2db7a24b73be /src/command/commands.c
parente58be44f8185a0fbb43a3ee902acf21c89b158b6 (diff)
downloadprofani-tty-cce01f1d75a43b943237a11f9695e8426425210a.tar.gz
Added /roster unread preferrence
closes #712
Diffstat (limited to 'src/command/commands.c')
-rw-r--r--src/command/commands.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/command/commands.c b/src/command/commands.c
index 3ad79778..76904ef0 100644
--- a/src/command/commands.c
+++ b/src/command/commands.c
@@ -2310,6 +2310,33 @@ cmd_roster(ProfWin *window, const char *const command, gchar **args)
             return TRUE;
         }
 
+    } else if (g_strcmp0(args[0], "unread") == 0) {
+        if (g_strcmp0(args[1], "before") == 0) {
+            cons_show("Roster unread message count: before");
+            prefs_set_string(PREF_ROSTER_UNREAD, "before");
+            if (conn_status == JABBER_CONNECTED) {
+                rosterwin_roster();
+            }
+            return TRUE;
+        } else if (g_strcmp0(args[1], "after") == 0) {
+            cons_show("Roster unread message count: after");
+            prefs_set_string(PREF_ROSTER_UNREAD, "after");
+            if (conn_status == JABBER_CONNECTED) {
+                rosterwin_roster();
+            }
+            return TRUE;
+        } else if (g_strcmp0(args[1], "off") == 0) {
+            cons_show("Roster unread message count: off");
+            prefs_set_string(PREF_ROSTER_UNREAD, "off");
+            if (conn_status == JABBER_CONNECTED) {
+                rosterwin_roster();
+            }
+            return TRUE;
+        } else {
+            cons_bad_cmd_usage(command);
+            return TRUE;
+        }
+
     } else if (g_strcmp0(args[0], "room") == 0) {
         if (g_strcmp0(args[1], "order") == 0) {
             if (g_strcmp0(args[2], "name") == 0) {