summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES3
-rw-r--r--configs/jabber.conf.sample6
-rw-r--r--res/res_jabber.c13
3 files changed, 14 insertions, 8 deletions
diff --git a/CHANGES b/CHANGES
index 75c0533b0..45548f4e5 100644
--- a/CHANGES
+++ b/CHANGES
@@ -805,6 +805,9 @@ Miscellaneous New Modules
Miscellaneous
-------------
+ * res_jabber: autoprune has been disabled by default, to avoid misconfiguration
+ that would end up being interpreted as a bug once Asterisk started removing
+ the contacts from a user list.
* Ability to use libcap to set high ToS bits when non-root
on Linux. If configure is unable to find libcap then you
can use --with-cap to specify the path.
diff --git a/configs/jabber.conf.sample b/configs/jabber.conf.sample
index e817e48d0..6cfb755bd 100644
--- a/configs/jabber.conf.sample
+++ b/configs/jabber.conf.sample
@@ -1,7 +1,9 @@
[general]
;debug=yes ;;Turn on debugging by default.
-;autoprune=yes ;;Auto remove users from buddy list.
-;autoregister=yes ;;Auto register users from buddy list.
+;autoprune=yes ;;Auto remove users from buddy list. Depending on your
+ ;;setup (ie, using your personal Gtalk account for a test)
+ ;;you might lose your contacts list. Default is 'no'.
+;autoregister=yes ;;Auto register users from buddy list.
;[asterisk] ;;label
;type=client ;;Client or Component connection
diff --git a/res/res_jabber.c b/res/res_jabber.c
index 432b4a292..8f8f91af8 100644
--- a/res/res_jabber.c
+++ b/res/res_jabber.c
@@ -159,7 +159,7 @@ struct aji_client_container clients;
struct aji_capabilities *capabilities = NULL;
/*! \brief Global flags, initialized to default values */
-static struct ast_flags globalflags = { AJI_AUTOPRUNE | AJI_AUTOREGISTER };
+static struct ast_flags globalflags = { AJI_AUTOREGISTER };
/*!
* \brief Deletes the aji_client data structure.
@@ -2076,7 +2076,7 @@ static void aji_pruneregister(struct aji_client *client)
ASTOBJ_RDLOCK(iterator);
/* For an aji_buddy, both AUTOPRUNE and AUTOREGISTER will never
* be called at the same time */
- if (ast_test_flag(&iterator->flags, AJI_AUTOPRUNE)) {
+ if (ast_test_flag(&iterator->flags, AJI_AUTOPRUNE)) { /* If autoprune is set on jabber.conf */
res = ast_aji_send(client, iks_make_s10n(IKS_TYPE_UNSUBSCRIBE, iterator->name,
"GoodBye. Your status is no longer needed by Asterisk the Open Source PBX"
" so I am no longer subscribing to your presence.\n"));
@@ -2881,7 +2881,7 @@ static int aji_load_config(int reload)
return -1;
/* Reset flags to default value */
- ast_set_flag(&globalflags, AJI_AUTOPRUNE | AJI_AUTOREGISTER);
+ ast_set_flag(&globalflags, AJI_AUTOREGISTER);
if (!cfg) {
ast_log(LOG_WARNING, "No such configuration file %s\n", JABBER_CONFIG);
@@ -2890,12 +2890,13 @@ static int aji_load_config(int reload)
cat = ast_category_browse(cfg, NULL);
for (var = ast_variable_browse(cfg, "general"); var; var = var->next) {
- if (!strcasecmp(var->name, "debug"))
+ if (!strcasecmp(var->name, "debug")) {
debug = (ast_false(ast_variable_retrieve(cfg, "general", "debug"))) ? 0 : 1;
- else if (!strcasecmp(var->name, "autoprune"))
+ } else if (!strcasecmp(var->name, "autoprune")) {
ast_set2_flag(&globalflags, ast_true(var->value), AJI_AUTOPRUNE);
- else if (!strcasecmp(var->name, "autoregister"))
+ } else if (!strcasecmp(var->name, "autoregister")) {
ast_set2_flag(&globalflags, ast_true(var->value), AJI_AUTOREGISTER);
+ }
}
while (cat) {