about summary refs log tree commit diff stats
path: root/src/command/commands.c
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2014-05-24 15:54:10 +0100
committerJames Booth <boothj5@gmail.com>2014-05-24 15:54:10 +0100
commit7d90d218c0858ce278c8223fe72c455e3f950732 (patch)
tree87dee443e5afd20f8b34a12d54b29e1facd33cf3 /src/command/commands.c
parent663a22fb7e3d30255e73aeb220b1157cc35788f6 (diff)
downloadprofani-tty-7d90d218c0858ce278c8223fe72c455e3f950732.tar.gz
Split regular and chat room notify settings
Diffstat (limited to 'src/command/commands.c')
-rw-r--r--src/command/commands.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/command/commands.c b/src/command/commands.c
index fd50f08b..eb3ef91b 100644
--- a/src/command/commands.c
+++ b/src/command/commands.c
@@ -2200,7 +2200,7 @@ cmd_notify(gchar **args, struct cmd_help_t help)
     // bad kind
     if ((strcmp(kind, "message") != 0) && (strcmp(kind, "typing") != 0) &&
             (strcmp(kind, "remind") != 0) && (strcmp(kind, "invite") != 0) &&
-            (strcmp(kind, "sub") != 0)) {
+            (strcmp(kind, "sub") != 0) && (strcmp(kind, "room") != 0)) {
         cons_show("Usage: %s", help.usage);
 
     // set message setting
@@ -2215,6 +2215,18 @@ cmd_notify(gchar **args, struct cmd_help_t help)
             cons_show("Usage: /notify message on|off");
         }
 
+    // set room setting
+    } else if (strcmp(kind, "room") == 0) {
+        if (strcmp(value, "on") == 0) {
+            cons_show("Chat room notifications enabled.");
+            prefs_set_boolean(PREF_NOTIFY_ROOM, TRUE);
+        } else if (strcmp(value, "off") == 0) {
+            cons_show("Chat room notifications disabled.");
+            prefs_set_boolean(PREF_NOTIFY_ROOM, FALSE);
+        } else {
+            cons_show("Usage: /notify room on|off");
+        }
+
     // set typing setting
     } else if (strcmp(kind, "typing") == 0) {
         if (strcmp(value, "on") == 0) {