Commits

Ivan Vučica committed 52dade6

Fixed too early deletion of requesting iq from iqsAwaitingReply

  • Participants
  • Parent commits cfe24ec

Comments (0)

Files changed (1)

File zxmpp_stanzaiq.js

 			}
 		}
 	
-		if(this.id && this.zxmpp.stream.iqsAwaitingReply[this.id])
+		if(this.id && this.zxmpp.stream.iqsAwaitingReply[this.id] && (this.type == "result" || this.type == "error"))
 		{
-
 			delete this.zxmpp.stream.iqsAwaitingReply[this.id];
 		}
 	}
 			if(!askingIq)
 			{
 				console.error("No asking iq for id " + this.id);
+				console.log(xml);
+				console.log(this.zxmpp.stream.iqsAwaitingReply);
 				this.iqFail();
 				return; // FIXME make sure that, after failing, we give up on processing <iq> completely
 			}
 						}
 						// remember in db:
 						askingIq.extDest[askingIq.inquiringExt] = child.attr["var"];
-				
+						
+						// FIXME: DONT ASK ABOUT VCARD HERE
 						if(this.zxmpp.vCards[presence.bareJid] == undefined)
 						{
 							console.warn("Now requesting vcard for " + presence.bareJid);
 		packet.iqStanza = this;
 			
 		// remember we wait for a result or error <iq> stanza
+		console.log("appended " + this.type);
 		if(this.type == "set" || this.type == "get")
 		{
-			//console.log("remembering " + this.iqStanza.id);
+			//console.log("remembering " + this.id);
 			this.zxmpp.stream.iqsAwaitingReply[this.id] = this;
 		}
 	}