diff options
author | Remko Tronçon <git@el-tramo.be> | 2010-10-24 13:11:24 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2010-10-24 15:56:44 (GMT) |
commit | efc2bed8610f6e1b7fc29b3dd6f13137fc19bdf6 (patch) | |
tree | 7f7622a1c6f997a345d2278854d8084239fbf5bb | |
parent | 8234b6357de00f8355bef5af4b316329d4297033 (diff) | |
download | swift-contrib-efc2bed8610f6e1b7fc29b3dd6f13137fc19bdf6.zip swift-contrib-efc2bed8610f6e1b7fc29b3dd6f13137fc19bdf6.tar.bz2 |
Moved MUCRegistry into client.
-rw-r--r-- | Swift/Controllers/MainController.cpp | 12 | ||||
-rw-r--r-- | Swift/Controllers/MainController.h | 4 | ||||
-rw-r--r-- | Swiften/Client/Client.cpp | 5 | ||||
-rw-r--r-- | Swiften/Client/Client.h | 6 |
4 files changed, 15 insertions, 12 deletions
diff --git a/Swift/Controllers/MainController.cpp b/Swift/Controllers/MainController.cpp index 111a070..c5b55bf 100644 --- a/Swift/Controllers/MainController.cpp +++ b/Swift/Controllers/MainController.cpp @@ -101,7 +101,6 @@ MainController::MainController( statusTracker_ = NULL; client_ = NULL; - mucRegistry_ = NULL; vcardManager_ = NULL; avatarManager_ = NULL; capsManager_ = NULL; @@ -216,8 +215,6 @@ void MainController::resetClient() { nickResolver_ = NULL; delete vcardManager_; vcardManager_ = NULL; - delete mucRegistry_; - mucRegistry_ = NULL; delete client_; client_ = NULL; delete statusTracker_; @@ -263,7 +260,7 @@ void MainController::handleConnected() { rosterController_->onChangeStatusRequest.connect(boost::bind(&MainController::handleChangeStatusRequest, this, _1, _2)); rosterController_->onSignOutRequest.connect(boost::bind(&MainController::signOut, this)); - chatsManager_ = new ChatsManager(jid_, client_->getStanzaChannel(), client_->getIQRouter(), eventController_, chatWindowFactory_, nickResolver_, client_->getPresenceOracle(), client_->getPresenceSender(), uiEventStream_, chatListWindowFactory_, useDelayForLatency_, &timerFactory_, mucRegistry_, entityCapsManager_); + chatsManager_ = new ChatsManager(jid_, client_->getStanzaChannel(), client_->getIQRouter(), eventController_, chatWindowFactory_, nickResolver_, client_->getPresenceOracle(), client_->getPresenceSender(), uiEventStream_, chatListWindowFactory_, useDelayForLatency_, &timerFactory_, client_->getMUCRegistry(), entityCapsManager_); client_->onMessageReceived.connect(boost::bind(&ChatsManager::handleIncomingMessage, chatsManager_, _1)); chatsManager_->setAvatarManager(avatarManager_); @@ -401,14 +398,13 @@ void MainController::performLoginFromCachedCredentials() { client_->setSoftwareVersion(CLIENT_NAME, buildVersion); - mucRegistry_ = new MUCRegistry(); vcardManager_ = new VCardManager(jid_, client_->getIQRouter(), getVCardStorageForProfile(jid_)); vcardManager_->onVCardChanged.connect(boost::bind(&MainController::handleVCardReceived, this, _1, _2)); - nickResolver_ = new NickResolver(this->jid_.toBare(), client_->getRoster(), vcardManager_, mucRegistry_); - avatarManager_ = new AvatarManagerImpl(vcardManager_, client_->getStanzaChannel(), avatarStorage_, mucRegistry_); + nickResolver_ = new NickResolver(this->jid_.toBare(), client_->getRoster(), vcardManager_, client_->getMUCRegistry()); + avatarManager_ = new AvatarManagerImpl(vcardManager_, client_->getStanzaChannel(), avatarStorage_, client_->getMUCRegistry()); capsManager_ = new CapsManager(capsStorage_, client_->getStanzaChannel(), client_->getIQRouter()); entityCapsManager_ = new EntityCapsManager(capsManager_, client_->getStanzaChannel()); - presenceNotifier_ = new PresenceNotifier(client_->getStanzaChannel(), notifier_, mucRegistry_, avatarManager_, nickResolver_, client_->getPresenceOracle(), &timerFactory_); + presenceNotifier_ = new PresenceNotifier(client_->getStanzaChannel(), notifier_, client_->getMUCRegistry(), avatarManager_, nickResolver_, client_->getPresenceOracle(), &timerFactory_); presenceNotifier_->onNotificationActivated.connect(boost::bind(&MainController::handleNotificationClicked, this, _1)); eventNotifier_ = new EventNotifier(eventController_, notifier_, avatarManager_, nickResolver_); eventNotifier_->onNotificationActivated.connect(boost::bind(&MainController::handleNotificationClicked, this, _1)); diff --git a/Swift/Controllers/MainController.h b/Swift/Controllers/MainController.h index 868f966..e04123c 100644 --- a/Swift/Controllers/MainController.h +++ b/Swift/Controllers/MainController.h @@ -43,7 +43,6 @@ namespace Swift { class MainWindow; class NickResolver; class RosterController; - class PresenceSender; class DiscoInfoResponder; class AvatarManager; class CapsManager; @@ -69,7 +68,6 @@ namespace Swift { class MUCSearchWindowFactory; class StatusTracker; class VCardStorageFactory; - class MUCRegistry; class Dock; class MainController { @@ -126,7 +124,6 @@ namespace Swift { PlatformIdleQuerier idleQuerier_; ActualIdleDetector idleDetector_; Client* client_; - PresenceSender* presenceSender_; ChatWindowFactory* chatWindowFactory_; MainWindowFactory* mainWindowFactory_; LoginWindowFactory* loginWindowFactory_; @@ -169,7 +166,6 @@ namespace Swift { int timeBeforeNextReconnect_; Timer::ref reconnectTimer_; StatusTracker* statusTracker_; - MUCRegistry* mucRegistry_; bool myStatusLooksOnline_; typedef std::map<String, VCardStorage*> VCardStorageMap; diff --git a/Swiften/Client/Client.cpp b/Swiften/Client/Client.cpp index 1b07b65..63cd89f 100644 --- a/Swiften/Client/Client.cpp +++ b/Swiften/Client/Client.cpp @@ -11,6 +11,7 @@ #include "Swiften/Roster/XMPPRosterController.h" #include "Swiften/Presence/PresenceOracle.h" #include "Swiften/Presence/PresenceSender.h" +#include "Swiften/MUC/MUCRegistry.h" namespace Swift { @@ -26,9 +27,13 @@ Client::Client(const JID& jid, const String& password) : CoreClient(jid, passwor presenceOracle->onPresenceSubscriptionRequest.connect(boost::ref(onPresenceSubscriptionRequest)); presenceSender = new PresenceSender(getStanzaChannel()); + + mucRegistry = new MUCRegistry(); } Client::~Client() { + delete mucRegistry; + delete presenceSender; delete presenceOracle; diff --git a/Swiften/Client/Client.h b/Swiften/Client/Client.h index 590e040..2b4aa45 100644 --- a/Swiften/Client/Client.h +++ b/Swiften/Client/Client.h @@ -15,6 +15,7 @@ namespace Swift { class XMPPRosterController; class PresenceOracle; class PresenceSender; + class MUCRegistry; /** * Provides the core functionality for writing XMPP client software. @@ -75,6 +76,10 @@ namespace Swift { return presenceSender; } + MUCRegistry* getMUCRegistry() const { + return mucRegistry; + } + public: /** * This signal is emitted when a JID changes presence. @@ -92,5 +97,6 @@ namespace Swift { XMPPRosterController* rosterController; PresenceOracle* presenceOracle; PresenceSender* presenceSender; + MUCRegistry* mucRegistry; }; } |