1
1
mirror of https://github.com/profanity-im/profanity.git synced 2025-01-03 14:57:42 -05:00

Added /receipts command

This commit is contained in:
James Booth 2015-03-15 19:48:19 +00:00
parent b21edfaa51
commit 2762f18a3e
6 changed files with 29 additions and 1 deletions

View File

@ -921,6 +921,15 @@ static struct cmd_t command_defs[] =
"The message carbons feature ensures that both sides of all conversations are shared with all the user's clients that implement this protocol.", "The message carbons feature ensures that both sides of all conversations are shared with all the user's clients that implement this protocol.",
NULL } } }, NULL } } },
{ "/receipts",
cmd_receipts, parse_args, 1, 1, &cons_receipts_setting,
{ "/reciepts on|off", "Message delivery receipts.",
{ "/reciepts on|off",
"----------------",
"Enable or disable message delivery receipts.",
"The user interface will indicate when a message has been received.",
NULL } } },
{ "/reconnect", { "/reconnect",
cmd_reconnect, parse_args, 1, 1, &cons_reconnect_setting, cmd_reconnect, parse_args, 1, 1, &cons_reconnect_setting,
{ "/reconnect seconds", "Set reconnect interval.", { "/reconnect seconds", "Set reconnect interval.",
@ -2020,7 +2029,7 @@ _cmd_complete_parameters(const char * const input)
// autocomplete boolean settings // autocomplete boolean settings
gchar *boolean_choices[] = { "/beep", "/intype", "/states", "/outtype", gchar *boolean_choices[] = { "/beep", "/intype", "/states", "/outtype",
"/flash", "/splash", "/chlog", "/grlog", "/mouse", "/history", "/flash", "/splash", "/chlog", "/grlog", "/mouse", "/history",
"/vercheck", "/privileges", "/presence", "/wrap", "/carbons" }; "/vercheck", "/privileges", "/presence", "/wrap", "/carbons", "/receipts" };
for (i = 0; i < ARRAY_SIZE(boolean_choices); i++) { for (i = 0; i < ARRAY_SIZE(boolean_choices); i++) {
result = autocomplete_param_with_func(input, boolean_choices[i], prefs_autocomplete_boolean_choice); result = autocomplete_param_with_func(input, boolean_choices[i], prefs_autocomplete_boolean_choice);

View File

@ -3938,6 +3938,13 @@ cmd_carbons(gchar **args, struct cmd_help_t help)
return result; return result;
} }
gboolean
cmd_receipts(gchar **args, struct cmd_help_t help)
{
return _cmd_set_boolean_preference(args[0], help,
"Message delivery receipts", PREF_RECEIPTS);
}
gboolean gboolean
cmd_away(gchar **args, struct cmd_help_t help) cmd_away(gchar **args, struct cmd_help_t help)
{ {

View File

@ -86,6 +86,7 @@ gboolean cmd_group(gchar **args, struct cmd_help_t help);
gboolean cmd_help(gchar **args, struct cmd_help_t help); gboolean cmd_help(gchar **args, struct cmd_help_t help);
gboolean cmd_history(gchar **args, struct cmd_help_t help); gboolean cmd_history(gchar **args, struct cmd_help_t help);
gboolean cmd_carbons(gchar **args, struct cmd_help_t help); gboolean cmd_carbons(gchar **args, struct cmd_help_t help);
gboolean cmd_receipts(gchar **args, struct cmd_help_t help);
gboolean cmd_info(gchar **args, struct cmd_help_t help); gboolean cmd_info(gchar **args, struct cmd_help_t help);
gboolean cmd_intype(gchar **args, struct cmd_help_t help); gboolean cmd_intype(gchar **args, struct cmd_help_t help);
gboolean cmd_invite(gchar **args, struct cmd_help_t help); gboolean cmd_invite(gchar **args, struct cmd_help_t help);

View File

@ -1196,6 +1196,15 @@ cons_carbons_setting(void)
cons_show("Message carbons (/carbons) : OFF"); cons_show("Message carbons (/carbons) : OFF");
} }
void
cons_receipts_setting(void)
{
if (prefs_get_boolean(PREF_RECEIPTS))
cons_show("Message receipts (/reciepts) : ON");
else
cons_show("Message receipts (/receipts) : OFF");
}
void void
cons_show_chat_prefs(void) cons_show_chat_prefs(void)
{ {

View File

@ -318,6 +318,7 @@ void cons_intype_setting(void);
void cons_gone_setting(void); void cons_gone_setting(void);
void cons_history_setting(void); void cons_history_setting(void);
void cons_carbons_setting(void); void cons_carbons_setting(void);
void cons_receipts_setting(void);
void cons_log_setting(void); void cons_log_setting(void);
void cons_chlog_setting(void); void cons_chlog_setting(void);
void cons_grlog_setting(void); void cons_grlog_setting(void);

View File

@ -468,6 +468,7 @@ void cons_intype_setting(void) {}
void cons_gone_setting(void) {} void cons_gone_setting(void) {}
void cons_history_setting(void) {} void cons_history_setting(void) {}
void cons_carbons_setting(void) {} void cons_carbons_setting(void) {}
void cons_receipts_setting(void) {}
void cons_log_setting(void) {} void cons_log_setting(void) {}
void cons_chlog_setting(void) {} void cons_chlog_setting(void) {}
void cons_grlog_setting(void) {} void cons_grlog_setting(void) {}