Add XEP-0280 support

This commit is contained in:
Olivier LE MOAL
2015-02-02 11:10:05 +01:00
parent 5c9dd2802a
commit 48f9f3b3b0
17 changed files with 161 additions and 1 deletions

View File

@@ -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.",

View File

@@ -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" };
@@ -3887,6 +3887,22 @@ cmd_history(gchar **args, struct cmd_help_t help)
return result;
}
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)
{

View File

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