From ec923326d40708e2ef639bf191126ecb197c4c30 Mon Sep 17 00:00:00 2001
From: Kevin Smith <git@kismith.co.uk>
Date: Sun, 5 Dec 2010 13:40:48 +0000
Subject: Don't mess up avatars after a MUC reconnect.

Resolves: #702

diff --git a/Swiften/MUC/MUC.cpp b/Swiften/MUC/MUC.cpp
index 4185fa8..dd57698 100644
--- a/Swiften/MUC/MUC.cpp
+++ b/Swiften/MUC/MUC.cpp
@@ -25,7 +25,6 @@ typedef std::pair<String, MUCOccupant> StringMUCOccupantPair;
 
 MUC::MUC(StanzaChannel* stanzaChannel, IQRouter* iqRouter, DirectedPresenceSender* presenceSender, const JID &muc, MUCRegistry* mucRegistry) : ownMUCJID(muc), stanzaChannel(stanzaChannel), iqRouter_(iqRouter), presenceSender(presenceSender), mucRegistry(mucRegistry) {
 	scopedConnection_ = stanzaChannel->onPresenceReceived.connect(boost::bind(&MUC::handleIncomingPresence, this, _1));
-	mucRegistry->addMUC(getJID());
 }
 
 //FIXME: discover reserved nickname
@@ -41,6 +40,7 @@ void MUC::joinAs(const String &nick) {
 void MUC::internalJoin(const String &nick) {
 	//TODO: password
 	//TODO: history request
+	mucRegistry->addMUC(getJID());
 	joinComplete_ = false;
 	ownMUCJID = JID(ownMUCJID.getNode(), ownMUCJID.getDomain(), nick);
 	boost::shared_ptr<Presence> joinPresence(presenceSender->getLastSentUndirectedPresence());
-- 
cgit v0.10.2-6-g49f6