 		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 ] );
+			}
 		}
 
 		/**

			var callbackMethod:String = null;
			var subscription:String = RosterExtension.SUBSCRIBE_TYPE_NONE;
			var askType:String = RosterExtension.ASK_TYPE_NONE;

			if ( requestSubscription == true )
			{
				callbackObj = this;
				callbackMethod = "addContact_result";
				pendingSubscriptionRequestJID = id;
				pendingSubscriptionRequests.push(id);
				subscription = RosterExtension.SUBSCRIBE_TYPE_TO;
				askType = RosterExtension.ASK_TYPE_SUBSCRIBE
			}

			var tempIQ:IQ = new IQ( null, IQ.TYPE_SET, XMPPStanza.generateID( "add_user_" ),
									callbackMethod, callbackObj );
			var ext:RosterExtension = new RosterExtension( tempIQ.getNode() );
			ext.addItem( id.escaped, null, displayName, groupName ? [ groupName ] :
						 null );

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