summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMateusz Piekos <mateuszpiekos@gmail.com>2012-06-06 10:04:59 (GMT)
committerMateusz Piekos <mateuszpiekos@gmail.com>2012-06-06 10:04:59 (GMT)
commit8f85ae770025fd13e8f39e5097964768396f5b6b (patch)
treeb4eadab32223577657dced8361c21358d6dbb24d /Swift/Controllers
parentfa2edf2f9dfa77129e749373d7045b98d1dcced5 (diff)
downloadswift-contrib-8f85ae770025fd13e8f39e5097964768396f5b6b.zip
swift-contrib-8f85ae770025fd13e8f39e5097964768396f5b6b.tar.bz2
Moved whiteboard data handling to WhiteboardSession
Diffstat (limited to 'Swift/Controllers')
-rw-r--r--Swift/Controllers/MainController.cpp2
-rw-r--r--Swift/Controllers/UIInterfaces/WhiteboardWindowFactory.h6
-rw-r--r--Swift/Controllers/WhiteboardManager.cpp6
-rw-r--r--Swift/Controllers/WhiteboardManager.h6
4 files changed, 11 insertions, 9 deletions
diff --git a/Swift/Controllers/MainController.cpp b/Swift/Controllers/MainController.cpp
index d9bb249..b3457d8 100644
--- a/Swift/Controllers/MainController.cpp
+++ b/Swift/Controllers/MainController.cpp
@@ -320,7 +320,7 @@ void MainController::handleConnected() {
userSearchControllerChat_ = new UserSearchController(UserSearchController::StartChat, jid_, uiEventStream_, client_->getVCardManager(), uiFactory_, client_->getIQRouter(), rosterController_);
userSearchControllerAdd_ = new UserSearchController(UserSearchController::AddContact, jid_, uiEventStream_, client_->getVCardManager(), uiFactory_, client_->getIQRouter(), rosterController_);
adHocManager_ = new AdHocManager(JID(boundJID_.getDomain()), uiFactory_, client_->getIQRouter(), uiEventStream_, rosterController_->getWindow());
- whiteboardManager_ = new WhiteboardManager(uiFactory_, uiEventStream_, client_->getStanzaChannel());
+ whiteboardManager_ = new WhiteboardManager(uiFactory_, uiEventStream_, client_->getStanzaChannel(), client_->getWhiteboardSessionManager());
}
loginWindow_->setIsLoggingIn(false);
diff --git a/Swift/Controllers/UIInterfaces/WhiteboardWindowFactory.h b/Swift/Controllers/UIInterfaces/WhiteboardWindowFactory.h
index 8b52ee1..7e0fe81 100644
--- a/Swift/Controllers/UIInterfaces/WhiteboardWindowFactory.h
+++ b/Swift/Controllers/UIInterfaces/WhiteboardWindowFactory.h
@@ -6,16 +6,14 @@
#pragma once
-#include "Swiften/JID/JID.h"
-
namespace Swift {
+ class WhiteboardSession;
class WhiteboardWindow;
- class StanzaChannel;
class WhiteboardWindowFactory {
public :
virtual ~WhiteboardWindowFactory() {};
- virtual WhiteboardWindow* createWhiteboardWindow(StanzaChannel* stanzaChannel, const JID& jid) = 0;
+ virtual WhiteboardWindow* createWhiteboardWindow(WhiteboardSession* whiteboardSession) = 0;
};
}
diff --git a/Swift/Controllers/WhiteboardManager.cpp b/Swift/Controllers/WhiteboardManager.cpp
index 6237426..86d70d1 100644
--- a/Swift/Controllers/WhiteboardManager.cpp
+++ b/Swift/Controllers/WhiteboardManager.cpp
@@ -11,11 +11,12 @@
#include <Swiften/Base/foreach.h>
#include <Swift/Controllers/UIEvents/RequestWhiteboardUIEvent.h>
#include <Swiften/Client/StanzaChannel.h>
+#include <Swiften/Whiteboard/WhiteboardSessionManager.h>
namespace Swift {
typedef std::pair<JID, WhiteboardWindow*> JIDWhiteboardWindowPair;
- WhiteboardManager::WhiteboardManager(WhiteboardWindowFactory* whiteboardWindowFactory, UIEventStream* uiEventStream, StanzaChannel* stanzaChannel) : whiteboardWindowFactory_(whiteboardWindowFactory), uiEventStream_(uiEventStream), stanzaChannel_(stanzaChannel) {
+ WhiteboardManager::WhiteboardManager(WhiteboardWindowFactory* whiteboardWindowFactory, UIEventStream* uiEventStream, StanzaChannel* stanzaChannel, WhiteboardSessionManager* whiteboardSessionManager) : whiteboardWindowFactory_(whiteboardWindowFactory), uiEventStream_(uiEventStream), stanzaChannel_(stanzaChannel), whiteboardSessionManager_(whiteboardSessionManager) {
uiEventConnection_ = uiEventStream_->onUIEvent.connect(boost::bind(&WhiteboardManager::handleUIEvent, this, _1));
}
@@ -33,7 +34,8 @@ namespace Swift {
}
WhiteboardWindow* WhiteboardManager::createNewWhiteboardWindow(const JID& contact) {
- WhiteboardWindow *window = whiteboardWindowFactory_->createWhiteboardWindow(stanzaChannel_, contact);
+ WhiteboardSession* session = whiteboardSessionManager_->createSession(contact);
+ WhiteboardWindow *window = whiteboardWindowFactory_->createWhiteboardWindow(session);
whiteboardWindows_[contact] = window;
return window;
}
diff --git a/Swift/Controllers/WhiteboardManager.h b/Swift/Controllers/WhiteboardManager.h
index c28492c..a5a3dd0 100644
--- a/Swift/Controllers/WhiteboardManager.h
+++ b/Swift/Controllers/WhiteboardManager.h
@@ -19,10 +19,11 @@
namespace Swift {
class StanzaChannel;
+ class WhiteboardSessionManager;
class WhiteboardManager {
public:
- WhiteboardManager(WhiteboardWindowFactory* whiteboardWindowFactory, UIEventStream* uiEventStream, StanzaChannel* stanzaChannel);
+ WhiteboardManager(WhiteboardWindowFactory* whiteboardWindowFactory, UIEventStream* uiEventStream, StanzaChannel* stanzaChannel, WhiteboardSessionManager* whiteboardSessionManager);
~WhiteboardManager();
WhiteboardWindow* getWhiteboardWindowOrCreate(const JID& contact);
@@ -33,9 +34,10 @@ namespace Swift {
private:
std::map<JID, WhiteboardWindow*> whiteboardWindows_;
- UIEventStream* uiEventStream_;
WhiteboardWindowFactory* whiteboardWindowFactory_;
+ UIEventStream* uiEventStream_;
boost::bsignals::scoped_connection uiEventConnection_;
StanzaChannel* stanzaChannel_;
+ WhiteboardSessionManager* whiteboardSessionManager_;
};
}