[asterisk-commits] phsultan: branch 1.6.0 r142281 - in /branches/1.6.0: ./ configs/ res/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Sep 9 17:14:41 CDT 2008


Author: phsultan
Date: Tue Sep  9 17:14:40 2008
New Revision: 142281

URL: http://svn.digium.com/view/asterisk?view=rev&rev=142281
Log:
Merged revisions 142280 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

........
r142280 | phsultan | 2008-09-10 00:08:56 +0200 (Wed, 10 Sep 2008) | 6 lines

Disable autoprune by default.
(closes issue #13411)
Reported by: caio1982
Patches:
      res_jabber_autoprune1.diff uploaded by caio1982 (license 22)
Tested by: caio1982
........

Modified:
    branches/1.6.0/   (props changed)
    branches/1.6.0/CHANGES
    branches/1.6.0/configs/jabber.conf.sample
    branches/1.6.0/res/res_jabber.c

Propchange: branches/1.6.0/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.

Modified: branches/1.6.0/CHANGES
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/CHANGES?view=diff&rev=142281&r1=142280&r2=142281
==============================================================================
--- branches/1.6.0/CHANGES (original)
+++ branches/1.6.0/CHANGES Tue Sep  9 17:14:40 2008
@@ -532,6 +532,9 @@
 
 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.

Modified: branches/1.6.0/configs/jabber.conf.sample
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/configs/jabber.conf.sample?view=diff&rev=142281&r1=142280&r2=142281
==============================================================================
--- branches/1.6.0/configs/jabber.conf.sample (original)
+++ branches/1.6.0/configs/jabber.conf.sample Tue Sep  9 17:14:40 2008
@@ -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

Modified: branches/1.6.0/res/res_jabber.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/res/res_jabber.c?view=diff&rev=142281&r1=142280&r2=142281
==============================================================================
--- branches/1.6.0/res/res_jabber.c (original)
+++ branches/1.6.0/res/res_jabber.c Tue Sep  9 17:14:40 2008
@@ -159,7 +159,7 @@
 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 @@
 		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 @@
 		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 @@
 
 	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) {




More information about the asterisk-commits mailing list