]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
[patch] Buddies are always auto-registered when processing the roster
authorJonathan Rose <jrose@digium.com>
Fri, 26 Aug 2011 16:19:07 +0000 (16:19 +0000)
committerJonathan Rose <jrose@digium.com>
Fri, 26 Aug 2011 16:19:07 +0000 (16:19 +0000)
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

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@333378 65c4cc65-6c06-0410-ace0-fbb531ad65f3

res/res_jabber.c

index b1c94d9a454eed2bea2a2964bb70233259625ea6..bc4f0ad251b0493ea1520d706820e26d4a0ec820 100644 (file)
@@ -2992,10 +2992,12 @@ static int aji_filter_roster(void *data, ikspak *pak)
                        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) {