diff options
| author | Olivier LE MOAL <olivier.lemoal@winamax.fr> | 2015-02-02 11:10:05 +0100 |
|---|---|---|
| committer | Olivier LE MOAL <olivier.lemoal@winamax.fr> | 2015-02-10 11:32:22 +0100 |
| commit | 48f9f3b3b0d4e12f55ba5ea2c34695e899916c3d (patch) | |
| tree | 374b896113ea765bbaf05545bc42da0ff66d3570 /src/command | |
| parent | 5c9dd2802a6aefcaa67cbf03a65128b595b587c9 (diff) | |
| download | profani-tty-48f9f3b3b0d4e12f55ba5ea2c34695e899916c3d.tar.gz | |
Add XEP-0280 support
Diffstat (limited to 'src/command')
| -rw-r--r-- | src/command/command.c | 9 | ||||
| -rw-r--r-- | src/command/commands.c | 18 | ||||
| -rw-r--r-- | src/command/commands.h | 1 |
3 files changed, 27 insertions, 1 deletions
diff --git a/src/command/command.c b/src/command/command.c index f05d2a79..b4daadcc 100644 --- a/src/command/command.c +++ b/src/command/command.c @@ -859,6 +859,15 @@ static struct cmd_t command_defs[] = "shared : Share logs between all instances, accepts 'on' or 'off', defaults to 'on'.", NULL } } }, + { "/carbons", + cmd_carbons, parse_args, 1, 1, &cons_carbons_setting, + { "/carbons on|off", "Message carbons.", + { "/carbons on|off", + "---------------", + "Enable or disable message carbons.", + "The message carbons feature ensures that both sides of all conversations are shared with all the user's clients that implement this protocol.", + NULL } } }, + { "/reconnect", cmd_reconnect, parse_args, 1, 1, &cons_reconnect_setting, { "/reconnect seconds", "Set reconnect interval.", diff --git a/src/command/commands.c b/src/command/commands.c index 6eca1bd1..f6784fb5 100644 --- a/src/command/commands.c +++ b/src/command/commands.c @@ -730,7 +730,7 @@ cmd_help(gchar **args, struct cmd_help_t help) } else if (strcmp(args[0], "settings") == 0) { gchar *filter[] = { "/account", "/autoaway", "/autoping", "/autoconnect", "/beep", - "/chlog", "/flash", "/gone", "/grlog", "/history", "/intype", + "/carbons", "/chlog", "/flash", "/gone", "/grlog", "/history", "/intype", "/log", "/mouse", "/notify", "/outtype", "/prefs", "/priority", "/reconnect", "/roster", "/splash", "/states", "/statuses", "/theme", "/titlebar", "/vercheck", "/privileges", "/occupants", "/presence", "/wrap" }; @@ -3888,6 +3888,22 @@ cmd_history(gchar **args, struct cmd_help_t help) } gboolean +cmd_carbons(gchar **args, struct cmd_help_t help) +{ + gboolean result = _cmd_set_boolean_preference(args[0], help, + "Carbons message", PREF_CARBONS); + + // enable carbons + if (strcmp(args[0], "on") == 0) { + iq_enable_carbons(); + } + else if (strcmp(args[0], "off") == 0){ + iq_disable_carbons(); + } + return result; +} + +gboolean cmd_away(gchar **args, struct cmd_help_t help) { _update_presence(RESOURCE_AWAY, "away", args); diff --git a/src/command/commands.h b/src/command/commands.h index f4e040a9..1c16d635 100644 --- a/src/command/commands.h +++ b/src/command/commands.h @@ -85,6 +85,7 @@ gboolean cmd_grlog(gchar **args, struct cmd_help_t help); gboolean cmd_group(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_carbons(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_invite(gchar **args, struct cmd_help_t help); |