[asterisk-commits] jrose: branch 1.8 r333378 - /branches/1.8/res/res_jabber.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Aug 26 11:19:16 CDT 2011


Author: jrose
Date: Fri Aug 26 11:19:07 2011
New Revision: 333378

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=333378
Log:
[patch] Buddies are always auto-registered when processing the roster

Reporter said autoregister flag was ignored for registering 'buddies' which
had a subscription to us. Verified that this was the case and observed how
the patch addressed this and made sure it didn't break anything.

(closes issue ASTERISK-14233)
Reported by: Simon Arlott
Patches:
      asterisk-0015229.patch (license #5756) patch uploaded by Simon Arlott
Tested by: Jonathan Rose


Modified:
    branches/1.8/res/res_jabber.c

Modified: branches/1.8/res/res_jabber.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/res/res_jabber.c?view=diff&rev=333378&r1=333377&r2=333378
==============================================================================
--- branches/1.8/res/res_jabber.c (original)
+++ branches/1.8/res/res_jabber.c Fri Aug 26 11:19:07 2011
@@ -2992,10 +2992,12 @@
 			if (ast_test_flag(&client->flags, AJI_AUTOPRUNE)) {
 				ast_set_flag(&buddy->flags, AJI_AUTOPRUNE);
 				ASTOBJ_MARK(buddy);
-			} else if (!iks_strcmp(iks_find_attrib(x, "subscription"), "none") || !iks_strcmp(iks_find_attrib(x, "subscription"), "from")) {
-				/* subscribe to buddy's presence only
-				   if we really need to */
-				ast_set_flag(&buddy->flags, AJI_AUTOREGISTER);
+			} else if (ast_test_flag(&client->flags, AJI_AUTOREGISTER)) {
+				if (!iks_strcmp(iks_find_attrib(x, "subscription"), "none") || !iks_strcmp(iks_find_attrib(x, "subscription"), "from")) {
+					/* subscribe to buddy's presence only
+					   if we really need to */
+					ast_set_flag(&buddy->flags, AJI_AUTOREGISTER);
+				}
 			}
 			ASTOBJ_UNLOCK(buddy);
 			if (buddy) {




More information about the asterisk-commits mailing list