Split regular and chat room notify settings

This commit is contained in:
James Booth
2014-05-24 15:54:10 +01:00
parent 663a22fb7e
commit 7d90d218c0
6 changed files with 29 additions and 4 deletions

View File

@@ -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) {