From 4b6a520ff560cdb16140d4cd3c25660b3d76227a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Remko=20Tron=C3=A7on?= <git@el-tramo.be>
Date: Fri, 17 Sep 2010 11:27:02 +0200
Subject: Fixed VCard request being sent too early.

Cause is NickResolver being instantiated earlier due to a recent
refactoring.

diff --git a/Swift/Controllers/NickResolver.cpp b/Swift/Controllers/NickResolver.cpp
index 5029b7d..2cc6562 100644
--- a/Swift/Controllers/NickResolver.cpp
+++ b/Swift/Controllers/NickResolver.cpp
@@ -13,6 +13,10 @@
 #include "Swiften/Roster/XMPPRoster.h"
 #include "Swiften/VCards/VCardManager.h"
 
+// FIXME: The NickResolver currently relies on the vcard being requested by the client on login.
+// The VCardManager should get an onConnected() signal (which is signalled when the stanzachannel is available(, and each time this is emitted,
+// the nickresolver should request the vcard.
+
 namespace Swift {
 
 NickResolver::NickResolver(const JID& ownJID, XMPPRoster* xmppRoster, VCardManager* vcardManager, MUCRegistry* mucRegistry) : ownJID_(ownJID) {
@@ -20,8 +24,6 @@ NickResolver::NickResolver(const JID& ownJID, XMPPRoster* xmppRoster, VCardManag
 	vcardManager_ = vcardManager;
 	if (vcardManager_) {
 		vcardManager_->onVCardChanged.connect(boost::bind(&NickResolver::handleVCardReceived, this, _1, _2));
-		VCard::ref ownVCard = vcardManager_->getVCardAndRequestWhenNeeded(ownJID_);
-		handleVCardReceived(ownJID_, ownVCard);
 	}
 	mucRegistry_ = mucRegistry;
 }
-- 
cgit v0.10.2-6-g49f6