 		public function addContact_result( resultIQ:IQ ):void
 		{
 			// Contact was added, request subscription
-			// TODO: Should check the JID of the result
-			requestSubscription( pendingSubscriptionRequestJID );
-			pendingSubscriptionRequestJID = null;
+
+			var iqID : String = resultIQ.id.toString();
+
+			if ( pendingSubscriptionRequests.hasOwnProperty( iqID ) )
+			{
+				var subscriptionId : UnescapedJID = pendingSubscriptionRequests[ iqID ] as UnescapedJID;
+				requestSubscription( subscriptionId );
+				delete( pendingSubscriptionRequests[ iqID ] );
+			}
 		}
 
 		/**

 */
package org.igniterealtime.xiff.im
{
	import org.igniterealtime.xiff.collections.ArrayCollection;
	import org.igniterealtime.xiff.core.*;
	import org.igniterealtime.xiff.data.*;

		 * Store presences of the people in users roster.
		 */
		private var _presenceMap:Object = {};
		
		/**
		 * List of <code>UnescapedJID</code> which are pending for subscription.
		 */
		private var pendingSubscriptionRequests : Dictionary = new Dictionary();

		/**
		 *
