[svn-commits] trunk r32634 - /trunk/res/res_jabber.c

svn-commits at lists.digium.com svn-commits at lists.digium.com
Tue Jun 6 10:25:07 MST 2006


Author: mogorman
Date: Tue Jun  6 12:25:07 2006
New Revision: 32634

URL: http://svn.digium.com/view/asterisk?rev=32634&view=rev
Log:
fixed autoregister bug.

Modified:
    trunk/res/res_jabber.c

Modified: trunk/res/res_jabber.c
URL: http://svn.digium.com/view/asterisk/trunk/res/res_jabber.c?rev=32634&r1=32633&r2=32634&view=diff
==============================================================================
--- trunk/res/res_jabber.c (original)
+++ trunk/res/res_jabber.c Tue Jun  6 12:25:07 2006
@@ -1584,23 +1584,23 @@
 			});
 
 			if (!flag) {
-				if (ast_test_flag(client, AJI_AUTOPRUNE)) {
-					buddy = (struct aji_buddy *) malloc(sizeof(struct aji_buddy));
-					if (!buddy)
-						ast_log(LOG_WARNING, "Out of memory\n");
-					memset(buddy, 0, sizeof(struct aji_buddy));
-					ASTOBJ_INIT(buddy);
-					ASTOBJ_WRLOCK(buddy);
-					ast_copy_string(buddy->name, iks_find_attrib(x, "jid"), sizeof(buddy->name));
-					ast_copy_string(buddy->user, iks_find_attrib(x, "jid"), sizeof(buddy->user));
-					ast_clear_flag(buddy, AST_FLAGS_ALL);
+				buddy = (struct aji_buddy *) malloc(sizeof(struct aji_buddy));
+				if (!buddy)
+					ast_log(LOG_WARNING, "Out of memory\n");
+				memset(buddy, 0, sizeof(struct aji_buddy));
+				ASTOBJ_INIT(buddy);
+				ASTOBJ_WRLOCK(buddy);
+				ast_copy_string(buddy->name, iks_find_attrib(x, "jid"), sizeof(buddy->name));
+				ast_clear_flag(buddy, AST_FLAGS_ALL);
+				if(ast_test_flag(client, AJI_AUTOPRUNE)) {
 					ast_set_flag(buddy, AJI_AUTOPRUNE);
 					buddy->objflags |= ASTOBJ_FLAG_MARKED;
-					ASTOBJ_UNLOCK(buddy);
-					if (buddy) {
-						ASTOBJ_CONTAINER_LINK(&client->buddies, buddy);
-						ASTOBJ_UNREF(buddy, aji_buddy_destroy);
-					}
+				} else
+					ast_set_flag(buddy, AJI_AUTOREGISTER);
+				ASTOBJ_UNLOCK(buddy);
+				if (buddy) {
+					ASTOBJ_CONTAINER_LINK(&client->buddies, buddy);
+					ASTOBJ_UNREF(buddy, aji_buddy_destroy);
 				}
 			}
 		}



More information about the svn-commits mailing list