Added notify triggers WIP
This commit is contained in:
@@ -1054,7 +1054,7 @@ static struct cmd_t command_defs[] =
|
||||
},
|
||||
|
||||
{ "/notify",
|
||||
cmd_notify, parse_args, 2, 3, &cons_notify_setting,
|
||||
cmd_notify, parse_args_with_freetext, 2, 4, &cons_notify_setting,
|
||||
CMD_TAGS(
|
||||
CMD_TAG_UI,
|
||||
CMD_TAG_CHAT,
|
||||
@@ -1063,9 +1063,17 @@ static struct cmd_t command_defs[] =
|
||||
"/notify message on|off",
|
||||
"/notify message current on|off",
|
||||
"/notify message text on|off",
|
||||
"/notify message trigger add <text>",
|
||||
"/notify message trigger remove <text>",
|
||||
"/notify message trigger list",
|
||||
"/notify message trigger on|off",
|
||||
"/notify room on|off|mention",
|
||||
"/notify room current on|off",
|
||||
"/notify room text on|off",
|
||||
"/notify room trigger add <text>",
|
||||
"/notify room trigger remove <text>",
|
||||
"/notify room trigger list",
|
||||
"/notify room trigger on|off",
|
||||
"/notify remind <seconds>",
|
||||
"/notify typing on|off",
|
||||
"/notify typing current on|off",
|
||||
@@ -1074,17 +1082,25 @@ static struct cmd_t command_defs[] =
|
||||
CMD_DESC(
|
||||
"Settings for various kinds of desktop notifications.")
|
||||
CMD_ARGS(
|
||||
{ "message on|off", "Notifications for regular chat messages." },
|
||||
{ "message current on|off", "Whether messages in the current window trigger notifications." },
|
||||
{ "message text on|off", "Show message text in regular message notifications." },
|
||||
{ "room on|off|mention", "Notifications for chat room messages, mention triggers notifications only when your nick is mentioned." },
|
||||
{ "room current on|off", "Whether chat room messages in the current window trigger notifications." },
|
||||
{ "room text on|off", "Show message text in chat room message notifications." },
|
||||
{ "remind <seconds>", "Notification reminder period for unread messages, use 0 to disable." },
|
||||
{ "typing on|off", "Notifications when contacts are typing." },
|
||||
{ "typing current on|off", "Whether typing notifications are triggered for the current window." },
|
||||
{ "invite on|off", "Notifications for chat room invites." },
|
||||
{ "sub on|off", "Notifications for subscription requests." })
|
||||
{ "message on|off", "Notifications for regular chat messages." },
|
||||
{ "message current on|off", "Whether messages in the current window trigger notifications." },
|
||||
{ "message text on|off", "Show message text in regular message notifications." },
|
||||
{ "message trigger add <text>", "Notify when specified text included in regular chat message." },
|
||||
{ "message trigger remove <text>", "Remove regular chat notification for specified text." },
|
||||
{ "message trigger list", "List all regular chat custom text notifications." },
|
||||
{ "message trigger on|off", "Enable or disable all regular chat custom text notifications." },
|
||||
{ "room on|off|mention", "Notifications for chat room messages, mention triggers notifications only when your nick is mentioned." },
|
||||
{ "room current on|off", "Whether chat room messages in the current window trigger notifications." },
|
||||
{ "room text on|off", "Show message text in chat room message notifications." },
|
||||
{ "room trigger add <text>", "Notify when specified text included in regular chat message." },
|
||||
{ "room trigger remove <text>", "Remove regular chat notification for specified text." },
|
||||
{ "room trigger list", "List all regular chat custom text notifications." },
|
||||
{ "room trigger on|off", "Enable or disable all regular chat custom text notifications." },
|
||||
{ "remind <seconds>", "Notification reminder period for unread messages, use 0 to disable." },
|
||||
{ "typing on|off", "Notifications when contacts are typing." },
|
||||
{ "typing current on|off", "Whether typing notifications are triggered for the current window." },
|
||||
{ "invite on|off", "Notifications for chat room invites." },
|
||||
{ "sub on|off", "Notifications for subscription requests." })
|
||||
CMD_EXAMPLES(
|
||||
"/notify message on",
|
||||
"/notify message text on",
|
||||
@@ -1777,6 +1793,7 @@ static Autocomplete notify_ac;
|
||||
static Autocomplete notify_room_ac;
|
||||
static Autocomplete notify_message_ac;
|
||||
static Autocomplete notify_typing_ac;
|
||||
static Autocomplete notify_trigger_ac;
|
||||
static Autocomplete prefs_ac;
|
||||
static Autocomplete sub_ac;
|
||||
static Autocomplete log_ac;
|
||||
@@ -1915,6 +1932,7 @@ cmd_init(void)
|
||||
autocomplete_add(notify_message_ac, "off");
|
||||
autocomplete_add(notify_message_ac, "current");
|
||||
autocomplete_add(notify_message_ac, "text");
|
||||
autocomplete_add(notify_message_ac, "trigger");
|
||||
|
||||
notify_room_ac = autocomplete_new();
|
||||
autocomplete_add(notify_room_ac, "on");
|
||||
@@ -1922,12 +1940,20 @@ cmd_init(void)
|
||||
autocomplete_add(notify_room_ac, "mention");
|
||||
autocomplete_add(notify_room_ac, "current");
|
||||
autocomplete_add(notify_room_ac, "text");
|
||||
autocomplete_add(notify_room_ac, "trigger");
|
||||
|
||||
notify_typing_ac = autocomplete_new();
|
||||
autocomplete_add(notify_typing_ac, "on");
|
||||
autocomplete_add(notify_typing_ac, "off");
|
||||
autocomplete_add(notify_typing_ac, "current");
|
||||
|
||||
notify_trigger_ac = autocomplete_new();
|
||||
autocomplete_add(notify_trigger_ac, "add");
|
||||
autocomplete_add(notify_trigger_ac, "remove");
|
||||
autocomplete_add(notify_trigger_ac, "list");
|
||||
autocomplete_add(notify_trigger_ac, "on");
|
||||
autocomplete_add(notify_trigger_ac, "off");
|
||||
|
||||
sub_ac = autocomplete_new();
|
||||
autocomplete_add(sub_ac, "request");
|
||||
autocomplete_add(sub_ac, "allow");
|
||||
@@ -2324,6 +2350,7 @@ cmd_uninit(void)
|
||||
autocomplete_free(notify_message_ac);
|
||||
autocomplete_free(notify_room_ac);
|
||||
autocomplete_free(notify_typing_ac);
|
||||
autocomplete_free(notify_trigger_ac);
|
||||
autocomplete_free(sub_ac);
|
||||
autocomplete_free(titlebar_ac);
|
||||
autocomplete_free(log_ac);
|
||||
@@ -2510,6 +2537,7 @@ cmd_reset_autocomplete(ProfWin *window)
|
||||
autocomplete_reset(notify_message_ac);
|
||||
autocomplete_reset(notify_room_ac);
|
||||
autocomplete_reset(notify_typing_ac);
|
||||
autocomplete_reset(notify_trigger_ac);
|
||||
autocomplete_reset(sub_ac);
|
||||
|
||||
autocomplete_reset(who_room_ac);
|
||||
@@ -3127,11 +3155,21 @@ _notify_autocomplete(ProfWin *window, const char *const input)
|
||||
return result;
|
||||
}
|
||||
|
||||
result = autocomplete_param_with_ac(input, "/notify room trigger", notify_trigger_ac, TRUE);
|
||||
if (result) {
|
||||
return result;
|
||||
}
|
||||
|
||||
result = autocomplete_param_with_func(input, "/notify message current", prefs_autocomplete_boolean_choice);
|
||||
if (result) {
|
||||
return result;
|
||||
}
|
||||
|
||||
result = autocomplete_param_with_ac(input, "/notify message trigger", notify_trigger_ac, TRUE);
|
||||
if (result) {
|
||||
return result;
|
||||
}
|
||||
|
||||
result = autocomplete_param_with_func(input, "/notify typing current", prefs_autocomplete_boolean_choice);
|
||||
if (result) {
|
||||
return result;
|
||||
|
||||
Reference in New Issue
Block a user