1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-12-04 14:46:46 -05:00

Renamed /notify message -> /notify chat

This commit is contained in:
James Booth 2015-11-29 00:08:49 +00:00
parent 04ad003e11
commit 3fbee4023e
7 changed files with 149 additions and 150 deletions

View File

@ -1060,9 +1060,9 @@ static struct cmd_t command_defs[] =
CMD_TAG_CHAT,
CMD_TAG_GROUPCHAT)
CMD_SYN(
"/notify message on|off",
"/notify message current on|off",
"/notify message text on|off",
"/notify chat on|off",
"/notify chat current on|off",
"/notify chat text on|off",
"/notify room on|off",
"/notify room mention on|off",
"/notify room current on|off",
@ -1073,8 +1073,8 @@ static struct cmd_t command_defs[] =
"/notify room trigger on|off",
"/notify on|off",
"/notify mention on|off",
"/notify trigger on|off"
"/notify reset"
"/notify trigger on|off",
"/notify reset",
"/notify remind <seconds>",
"/notify typing on|off",
"/notify typing current on|off",
@ -1083,34 +1083,34 @@ 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 to show regular chat message notifications when the window is focussed." },
{ "message text on|off", "Show message text in regular message notifications." },
{ "room on|off", "Notifications for all chat room messages, 'mention' only notifies when your nick is mentioned." },
{ "room mention on|off", "Notifications for all chat room messages when your nick is mentioned." },
{ "room current on|off", "Whether to show all chat room messages notifications when the window is focussed." },
{ "room text on|off", "Show message text in chat room message notifications." },
{ "room trigger add <text>", "Notify when specified text included in all chat room messages." },
{ "room trigger remove <text>", "Remove chat room notification trigger." },
{ "room trigger list", "List all chat room triggers." },
{ "room trigger on|off", "Enable or disable all chat room notification triggers." },
{ "on|off", "Notifications for the current chat room." },
{ "mention on|off", "Override the global 'mention' setting for the current chat room." },
{ "trigger on|off", "Override the global 'trigger' setting for the current chat room." },
{ "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." })
{ "chat on|off", "Notifications for regular chat messages." },
{ "chat current on|off", "Whether to show regular chat message notifications when the window is focussed." },
{ "chat text on|off", "Show message text in regular message notifications." },
{ "room on|off", "Notifications for all chat room messages, 'mention' only notifies when your nick is mentioned." },
{ "room mention on|off", "Notifications for all chat room messages when your nick is mentioned." },
{ "room current on|off", "Whether to show all chat room messages notifications when the window is focussed." },
{ "room text on|off", "Show message text in chat room message notifications." },
{ "room trigger add <text>", "Notify when specified text included in all chat room messages." },
{ "room trigger remove <text>", "Remove chat room notification trigger." },
{ "room trigger list", "List all chat room triggers." },
{ "room trigger on|off", "Enable or disable all chat room notification triggers." },
{ "on|off", "Override the global message setting for the current chat room." },
{ "mention on|off", "Override the global 'mention' setting for the current chat room." },
{ "trigger on|off", "Override the global 'trigger' setting for the current chat room." },
{ "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",
"/notify chat on",
"/notify chat text on",
"/notify room mention on",
"/notify room trigger add beer",
"/notify room trigger on",
"/notify room current off",
"/notify room text off",
"/notify remind 10",
"/notify remind 60",
"/notify typing on",
"/notify invite on")
},
@ -1807,8 +1807,8 @@ static Autocomplete who_roster_ac;
static Autocomplete help_ac;
static Autocomplete help_commands_ac;
static Autocomplete notify_ac;
static Autocomplete notify_chat_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;
@ -1937,7 +1937,7 @@ cmd_init(void)
autocomplete_add(prefs_ac, "pgp");
notify_ac = autocomplete_new();
autocomplete_add(notify_ac, "message");
autocomplete_add(notify_ac, "chat");
autocomplete_add(notify_ac, "room");
autocomplete_add(notify_ac, "typing");
autocomplete_add(notify_ac, "remind");
@ -1949,11 +1949,11 @@ cmd_init(void)
autocomplete_add(notify_ac, "trigger");
autocomplete_add(notify_ac, "reset");
notify_message_ac = autocomplete_new();
autocomplete_add(notify_message_ac, "on");
autocomplete_add(notify_message_ac, "off");
autocomplete_add(notify_message_ac, "current");
autocomplete_add(notify_message_ac, "text");
notify_chat_ac = autocomplete_new();
autocomplete_add(notify_chat_ac, "on");
autocomplete_add(notify_chat_ac, "off");
autocomplete_add(notify_chat_ac, "current");
autocomplete_add(notify_chat_ac, "text");
notify_room_ac = autocomplete_new();
autocomplete_add(notify_room_ac, "on");
@ -2368,7 +2368,7 @@ cmd_uninit(void)
autocomplete_free(help_ac);
autocomplete_free(help_commands_ac);
autocomplete_free(notify_ac);
autocomplete_free(notify_message_ac);
autocomplete_free(notify_chat_ac);
autocomplete_free(notify_room_ac);
autocomplete_free(notify_typing_ac);
autocomplete_free(notify_trigger_ac);
@ -2555,7 +2555,7 @@ cmd_reset_autocomplete(ProfWin *window)
autocomplete_reset(help_ac);
autocomplete_reset(help_commands_ac);
autocomplete_reset(notify_ac);
autocomplete_reset(notify_message_ac);
autocomplete_reset(notify_chat_ac);
autocomplete_reset(notify_room_ac);
autocomplete_reset(notify_typing_ac);
autocomplete_reset(notify_trigger_ac);
@ -3177,11 +3177,10 @@ _notify_autocomplete(ProfWin *window, const char *const input)
return result;
}
gchar *boolean_choices1[] = { "/notify room current", "/notify message current", "/notify typing current",
"/notify room text", "/notify room mention", "/notify message text" };
gchar *boolean_choices1[] = { "/notify room current", "/notify chat current", "/notify typing current",
"/notify room text", "/notify room mention", "/notify chat text" };
for (i = 0; i < ARRAY_SIZE(boolean_choices1); i++) {
result = autocomplete_param_with_func(input, boolean_choices1[i],
prefs_autocomplete_boolean_choice);
result = autocomplete_param_with_func(input, boolean_choices1[i], prefs_autocomplete_boolean_choice);
if (result) {
return result;
}
@ -3197,7 +3196,7 @@ _notify_autocomplete(ProfWin *window, const char *const input)
return result;
}
result = autocomplete_param_with_ac(input, "/notify message", notify_message_ac, TRUE);
result = autocomplete_param_with_ac(input, "/notify chat", notify_chat_ac, TRUE);
if (result) {
return result;
}
@ -3209,8 +3208,7 @@ _notify_autocomplete(ProfWin *window, const char *const input)
gchar *boolean_choices2[] = { "/notify invite", "/notify sub", "/notify mention", "/notify trigger"};
for (i = 0; i < ARRAY_SIZE(boolean_choices2); i++) {
result = autocomplete_param_with_func(input, boolean_choices2[i],
prefs_autocomplete_boolean_choice);
result = autocomplete_param_with_func(input, boolean_choices2[i], prefs_autocomplete_boolean_choice);
if (result) {
return result;
}

View File

@ -4280,23 +4280,23 @@ cmd_notify(ProfWin *window, const char *const command, gchar **args)
win_vprintln_ch(window, '!', "Notification settings for %s", mucwin->roomjid);
if (has_notify) {
if (prefs_get_room_notify(mucwin->roomjid)) {
win_vprintln_ch(window, '!', " All: ON");
win_vprintln_ch(window, '!', " Message : ON");
} else {
win_vprintln_ch(window, '!', " All: OFF");
win_vprintln_ch(window, '!', " Message : OFF");
}
}
if (has_notify_mention) {
if (prefs_get_room_notify_mention(mucwin->roomjid)) {
win_vprintln_ch(window, '!', " Mention: ON");
win_vprintln_ch(window, '!', " Mention : ON");
} else {
win_vprintln_ch(window, '!', " Mention: OFF");
win_vprintln_ch(window, '!', " Mention : OFF");
}
}
if (has_notify_trigger) {
if (prefs_get_room_notify_trigger(mucwin->roomjid)) {
win_vprintln_ch(window, '!', " Triggers: ON");
win_vprintln_ch(window, '!', " Triggers : ON");
} else {
win_vprintln_ch(window, '!', " Triggers: OFF");
win_vprintln_ch(window, '!', " Triggers : OFF");
}
}
}
@ -4306,33 +4306,33 @@ cmd_notify(ProfWin *window, const char *const command, gchar **args)
return TRUE;
}
// message settings
if (strcmp(args[0], "message") == 0) {
// chat settings
if (strcmp(args[0], "chat") == 0) {
if (strcmp(args[1], "on") == 0) {
cons_show("Message notifications enabled.");
prefs_set_boolean(PREF_NOTIFY_MESSAGE, TRUE);
cons_show("Chat notifications enabled.");
prefs_set_boolean(PREF_NOTIFY_CHAT, TRUE);
} else if (strcmp(args[1], "off") == 0) {
cons_show("Message notifications disabled.");
prefs_set_boolean(PREF_NOTIFY_MESSAGE, FALSE);
cons_show("Chat notifications disabled.");
prefs_set_boolean(PREF_NOTIFY_CHAT, FALSE);
} else if (strcmp(args[1], "current") == 0) {
if (g_strcmp0(args[2], "on") == 0) {
cons_show("Current window message notifications enabled.");
prefs_set_boolean(PREF_NOTIFY_MESSAGE_CURRENT, TRUE);
cons_show("Current window chat notifications enabled.");
prefs_set_boolean(PREF_NOTIFY_CHAT_CURRENT, TRUE);
} else if (g_strcmp0(args[2], "off") == 0) {
cons_show("Current window message notifications disabled.");
prefs_set_boolean(PREF_NOTIFY_MESSAGE_CURRENT, FALSE);
cons_show("Current window chat notifications disabled.");
prefs_set_boolean(PREF_NOTIFY_CHAT_CURRENT, FALSE);
} else {
cons_show("Usage: /notify message current on|off");
cons_show("Usage: /notify chat current on|off");
}
} else if (strcmp(args[1], "text") == 0) {
if (g_strcmp0(args[2], "on") == 0) {
cons_show("Showing text in message notifications enabled.");
prefs_set_boolean(PREF_NOTIFY_MESSAGE_TEXT, TRUE);
cons_show("Showing text in chat notifications enabled.");
prefs_set_boolean(PREF_NOTIFY_CHAT_TEXT, TRUE);
} else if (g_strcmp0(args[2], "off") == 0) {
cons_show("Showing text in message notifications disabled.");
prefs_set_boolean(PREF_NOTIFY_MESSAGE_TEXT, FALSE);
cons_show("Showing text in chat notifications disabled.");
prefs_set_boolean(PREF_NOTIFY_CHAT_TEXT, FALSE);
} else {
cons_show("Usage: /notify message text on|off");
cons_show("Usage: /notify chat text on|off");
}
}

View File

@ -195,7 +195,7 @@ prefs_reset_room_trigger_ac(void)
gboolean
prefs_do_chat_notify(gboolean current_win, const char *const message)
{
gboolean notify_current = prefs_get_boolean(PREF_NOTIFY_MESSAGE_CURRENT);
gboolean notify_current = prefs_get_boolean(PREF_NOTIFY_CHAT_CURRENT);
gboolean notify_window = FALSE;
if (!current_win || (current_win && notify_current) ) {
notify_window = TRUE;
@ -204,7 +204,7 @@ prefs_do_chat_notify(gboolean current_win, const char *const message)
return FALSE;
}
gboolean notify_message = prefs_get_boolean(PREF_NOTIFY_MESSAGE);
gboolean notify_message = prefs_get_boolean(PREF_NOTIFY_CHAT);
if (notify_message) {
return TRUE;
}
@ -1022,9 +1022,9 @@ _get_group(preference_t pref)
return PREF_GROUP_CHATSTATES;
case PREF_NOTIFY_TYPING:
case PREF_NOTIFY_TYPING_CURRENT:
case PREF_NOTIFY_MESSAGE:
case PREF_NOTIFY_MESSAGE_CURRENT:
case PREF_NOTIFY_MESSAGE_TEXT:
case PREF_NOTIFY_CHAT:
case PREF_NOTIFY_CHAT_CURRENT:
case PREF_NOTIFY_CHAT_TEXT:
case PREF_NOTIFY_ROOM:
case PREF_NOTIFY_ROOM_MENTION:
case PREF_NOTIFY_ROOM_TRIGGER:
@ -1114,11 +1114,11 @@ _get_key(preference_t pref)
return "typing";
case PREF_NOTIFY_TYPING_CURRENT:
return "typing.current";
case PREF_NOTIFY_MESSAGE:
case PREF_NOTIFY_CHAT:
return "message";
case PREF_NOTIFY_MESSAGE_CURRENT:
case PREF_NOTIFY_CHAT_CURRENT:
return "message.current";
case PREF_NOTIFY_MESSAGE_TEXT:
case PREF_NOTIFY_CHAT_TEXT:
return "message.text";
case PREF_NOTIFY_ROOM:
return "room";
@ -1236,8 +1236,8 @@ _get_default_boolean(preference_t pref)
case PREF_AUTOAWAY_CHECK:
case PREF_LOG_ROTATE:
case PREF_LOG_SHARED:
case PREF_NOTIFY_MESSAGE:
case PREF_NOTIFY_MESSAGE_CURRENT:
case PREF_NOTIFY_CHAT:
case PREF_NOTIFY_CHAT_CURRENT:
case PREF_NOTIFY_ROOM:
case PREF_NOTIFY_ROOM_CURRENT:
case PREF_NOTIFY_TYPING:

View File

@ -93,9 +93,9 @@ typedef enum {
PREF_OUTTYPE,
PREF_NOTIFY_TYPING,
PREF_NOTIFY_TYPING_CURRENT,
PREF_NOTIFY_MESSAGE,
PREF_NOTIFY_MESSAGE_CURRENT,
PREF_NOTIFY_MESSAGE_TEXT,
PREF_NOTIFY_CHAT,
PREF_NOTIFY_CHAT_CURRENT,
PREF_NOTIFY_CHAT_TEXT,
PREF_NOTIFY_ROOM,
PREF_NOTIFY_ROOM_MENTION,
PREF_NOTIFY_ROOM_TRIGGER,

View File

@ -290,7 +290,7 @@ chatwin_incoming_msg(ProfChatWin *chatwin, const char *const resource, const cha
ui_index = 0;
}
if (prefs_get_boolean(PREF_NOTIFY_MESSAGE_TEXT)) {
if (prefs_get_boolean(PREF_NOTIFY_CHAT_TEXT)) {
notify_message(display_name, ui_index, message);
} else {
notify_message(display_name, ui_index, NULL);

View File

@ -1323,77 +1323,78 @@ cons_show_ui_prefs(void)
void
cons_notify_setting(void)
{
if (is_notify_enabled()) {
if (prefs_get_boolean(PREF_NOTIFY_MESSAGE))
cons_show("Messages (/notify message) : ON");
else
cons_show("Messages (/notify message) : OFF");
if (prefs_get_boolean(PREF_NOTIFY_MESSAGE_CURRENT))
cons_show("Messages current (/notify message) : ON");
else
cons_show("Messages current (/notify message) : OFF");
if (prefs_get_boolean(PREF_NOTIFY_MESSAGE_TEXT))
cons_show("Messages text (/notify message) : ON");
else
cons_show("Messages text (/notify message) : OFF");
if (prefs_get_boolean(PREF_NOTIFY_ROOM))
cons_show("Room messages (/notify room) : ON");
else
cons_show("Room messages (/notify room) : OFF");
if (prefs_get_boolean(PREF_NOTIFY_ROOM_MENTION))
cons_show("Room mention (/notify room) : ON");
else
cons_show("Room mention (/notify room) : OFF");
if (prefs_get_boolean(PREF_NOTIFY_ROOM_TRIGGER))
cons_show("Room trigger (/notify room) : ON");
else
cons_show("Room trigger (/notify room) : OFF");
if (prefs_get_boolean(PREF_NOTIFY_ROOM_CURRENT))
cons_show("Room current (/notify room) : ON");
else
cons_show("Room current (/notify room) : OFF");
if (prefs_get_boolean(PREF_NOTIFY_ROOM_TEXT))
cons_show("Room text (/notify room) : ON");
else
cons_show("Room text (/notify room) : OFF");
if (prefs_get_boolean(PREF_NOTIFY_TYPING))
cons_show("Composing (/notify typing) : ON");
else
cons_show("Composing (/notify typing) : OFF");
if (prefs_get_boolean(PREF_NOTIFY_TYPING_CURRENT))
cons_show("Composing current (/notify typing) : ON");
else
cons_show("Composing current (/notify typing) : OFF");
if (prefs_get_boolean(PREF_NOTIFY_INVITE))
cons_show("Room invites (/notify invite) : ON");
else
cons_show("Room invites (/notify invite) : OFF");
if (prefs_get_boolean(PREF_NOTIFY_SUB))
cons_show("Subscription requests (/notify sub) : ON");
else
cons_show("Subscription requests (/notify sub) : OFF");
gint remind_period = prefs_get_notify_remind();
if (remind_period == 0) {
cons_show("Reminder period (/notify remind) : OFF");
} else if (remind_period == 1) {
cons_show("Reminder period (/notify remind) : 1 second");
} else {
cons_show("Reminder period (/notify remind) : %d seconds", remind_period);
}
} else {
if (!is_notify_enabled()) {
cons_show("Notification support was not included in this build.");
return;
}
if (prefs_get_boolean(PREF_NOTIFY_CHAT))
cons_show("Chat message (/notify chat) : ON");
else
cons_show("Chat message (/notify chat) : OFF");
if (prefs_get_boolean(PREF_NOTIFY_CHAT_CURRENT))
cons_show("Chat current (/notify chat) : ON");
else
cons_show("Chat current (/notify chat) : OFF");
if (prefs_get_boolean(PREF_NOTIFY_CHAT_TEXT))
cons_show("Chat text (/notify chat) : ON");
else
cons_show("Chat text (/notify chat) : OFF");
if (prefs_get_boolean(PREF_NOTIFY_ROOM))
cons_show("Room message (/notify room) : ON");
else
cons_show("Room message (/notify room) : OFF");
if (prefs_get_boolean(PREF_NOTIFY_ROOM_MENTION))
cons_show("Room mention (/notify room) : ON");
else
cons_show("Room mention (/notify room) : OFF");
if (prefs_get_boolean(PREF_NOTIFY_ROOM_TRIGGER))
cons_show("Room trigger (/notify room) : ON");
else
cons_show("Room trigger (/notify room) : OFF");
if (prefs_get_boolean(PREF_NOTIFY_ROOM_CURRENT))
cons_show("Room current (/notify room) : ON");
else
cons_show("Room current (/notify room) : OFF");
if (prefs_get_boolean(PREF_NOTIFY_ROOM_TEXT))
cons_show("Room text (/notify room) : ON");
else
cons_show("Room text (/notify room) : OFF");
if (prefs_get_boolean(PREF_NOTIFY_TYPING))
cons_show("Composing (/notify typing) : ON");
else
cons_show("Composing (/notify typing) : OFF");
if (prefs_get_boolean(PREF_NOTIFY_TYPING_CURRENT))
cons_show("Composing current (/notify typing) : ON");
else
cons_show("Composing current (/notify typing) : OFF");
if (prefs_get_boolean(PREF_NOTIFY_INVITE))
cons_show("Room invites (/notify invite) : ON");
else
cons_show("Room invites (/notify invite) : OFF");
if (prefs_get_boolean(PREF_NOTIFY_SUB))
cons_show("Subscription requests (/notify sub) : ON");
else
cons_show("Subscription requests (/notify sub) : OFF");
gint remind_period = prefs_get_notify_remind();
if (remind_period == 0) {
cons_show("Reminder period (/notify remind) : OFF");
} else if (remind_period == 1) {
cons_show("Reminder period (/notify remind) : 1 second");
} else {
cons_show("Reminder period (/notify remind) : %d seconds", remind_period);
}
}

View File

@ -91,7 +91,7 @@ privwin_incoming_msg(ProfPrivateWin *privatewin, const char *const message, GDat
ui_index = 0;
}
if (prefs_get_boolean(PREF_NOTIFY_MESSAGE_TEXT)) {
if (prefs_get_boolean(PREF_NOTIFY_CHAT_TEXT)) {
notify_message(display_from, ui_index, message);
} else {
notify_message(display_from, ui_index, NULL);