about summary refs log tree commit diff stats
path: root/src/command.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/command.c')
-rw-r--r--src/command.c33
1 files changed, 17 insertions, 16 deletions
diff --git a/src/command.c b/src/command.c
index 0c495947..2543e2ca 100644
--- a/src/command.c
+++ b/src/command.c
@@ -385,14 +385,11 @@ static struct cmd_t setting_commands[] =
           "        : use 0 to disable.",
           "typing  : Notifications when contacts are typing.",
           "        : on|off",
-          "status  : Notifcations for status messages.",
-          "        : on|off",
           "",
           "Example : /notify message on (enable message notifications)",
           "Example : /notify remind 10  (remind every 10 seconds)",
           "Example : /notify remind 0   (switch off reminders)",
           "Example : /notify typing on  (enable typing notifications)",
-          "Example : /notify status off (disable status notifications)",
           NULL } } },
 
     { "/flash",
@@ -540,6 +537,15 @@ static struct cmd_t setting_commands[] =
           "---------------",
           "Set priority for the current session.",
           "value : Number between -128 and 127. Default value is 0.",
+          NULL } } },
+
+    { "/statuses",
+        _cmd_set_statuses, parse_args, 1, 1,
+        { "/statuses on|off", "Set notifications for status messages.",
+        { "/statuses on|off",
+          "---------------",
+          "Set notifications for status messages, such as online/offline or join/part channels.",
+          "When notifications are off status messages, such as online/offline or join/part, are not displayed.",
           NULL } } }
 };
 
@@ -1782,7 +1788,7 @@ _cmd_set_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, "status") != 0)) {
+            (strcmp(kind, "remind") != 0)) {
         cons_show("Usage: %s", help.usage);
 
     // set message setting
@@ -1821,18 +1827,6 @@ _cmd_set_notify(gchar **args, struct cmd_help_t help)
             cons_show("Message reminder period set to %d seconds.", period);
         }
 
-    // set status setting
-    } else if (strcmp(kind, "status") == 0) {
-        if (strcmp(value, "on") == 0) {
-            cons_show("Status notifications enabled.");
-            prefs_set_notify_status(TRUE);
-        } else if (strcmp(value, "off") == 0) {
-            cons_show("Status notifications disabled.");
-            prefs_set_notify_status(FALSE);
-        } else {
-            cons_show("Usage: /notify status on|off");
-        }
-
     } else {
         cons_show("Unknown command: %s.", kind);
     }
@@ -1976,6 +1970,13 @@ _cmd_set_priority(gchar **args, struct cmd_help_t help)
 }
 
 static gboolean
+_cmd_set_statuses(gchar **args, struct cmd_help_t help)
+{
+    return _cmd_set_boolean_preference(args[0], help,
+        "Status notifications", prefs_set_statuses);
+}
+
+static gboolean
 _cmd_vercheck(gchar **args, struct cmd_help_t help)
 {
     int num_args = g_strv_length(args);