summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2010-09-06 15:48:27 (GMT)
committerRemko Tronçon <git@el-tramo.be>2010-09-11 21:53:43 (GMT)
commit6f31cc8a329d15767d54511edd14339ac3dfdd7a (patch)
treed41bdb8af487fed788f7a9bc88b1ab08ff567272 /Swift/Controllers
parentebccdadcae24932b299a8612a9c6e0cdc4e00249 (diff)
downloadswift-6f31cc8a329d15767d54511edd14339ac3dfdd7a.zip
swift-6f31cc8a329d15767d54511edd14339ac3dfdd7a.tar.bz2
Added support for Entity Capabilities.
Resolves: #94
Diffstat (limited to 'Swift/Controllers')
-rw-r--r--Swift/Controllers/MainController.cpp13
-rw-r--r--Swift/Controllers/MainController.h7
2 files changed, 19 insertions, 1 deletions
diff --git a/Swift/Controllers/MainController.cpp b/Swift/Controllers/MainController.cpp
index d742656..f3bd6d5 100644
--- a/Swift/Controllers/MainController.cpp
+++ b/Swift/Controllers/MainController.cpp
@@ -53,8 +53,11 @@
#include "Swiften/Disco/CapsInfoGenerator.h"
#include "Swiften/Queries/Requests/GetDiscoInfoRequest.h"
#include "Swiften/Queries/Requests/GetVCardRequest.h"
-#include "Swiften/Avatars/AvatarFileStorage.h"
+#include "Swiften/Avatars/AvatarStorage.h"
#include "Swiften/Avatars/AvatarManager.h"
+#include "Swiften/Disco/CapsFileStorage.h"
+#include "Swiften/Disco/CapsManager.h"
+#include "Swiften/Disco/EntityCapsManager.h"
#include "Swiften/StringCodecs/SHA1.h"
#include "Swiften/StringCodecs/Hexify.h"
@@ -78,6 +81,7 @@ MainController::MainController(
ChatListWindowFactory* chatListWindowFactory,
MUCSearchWindowFactory* mucSearchWindowFactory,
AvatarStorage* avatarStorage,
+ CapsStorage* capsStorage,
VCardStorageFactory* vcardStorageFactory,
ApplicationMessageDisplay* applicationMessageDisplay,
bool useDelayForLatency) :
@@ -115,6 +119,7 @@ MainController::MainController(
uiEventStream_ = new UIEventStream();
avatarStorage_ = avatarStorage;
+ capsStorage_ = capsStorage;
eventController_ = new EventController();
eventController_->onEventQueueLengthChange.connect(boost::bind(&MainController::handleEventQueueLengthChange, this, _1));
@@ -178,6 +183,10 @@ void MainController::resetClient() {
presenceOracle_ = NULL;
delete nickResolver_;
nickResolver_ = NULL;
+ delete entityCapsManager_;
+ entityCapsManager_ = NULL;
+ delete capsManager_;
+ capsManager_ = NULL;
delete avatarManager_;
avatarManager_ = NULL;
delete vcardManager_;
@@ -235,6 +244,8 @@ void MainController::handleConnected() {
vcardManager_ = new VCardManager(jid_, client_, getVCardStorageForProfile(jid_));
vcardManager_->onVCardChanged.connect(boost::bind(&MainController::handleVCardReceived, this, _1, _2));
avatarManager_ = new AvatarManager(vcardManager_, client_, avatarStorage_, mucRegistry_);
+ capsManager_ = new CapsManager(capsStorage_, client_, client_);
+ entityCapsManager_ = new EntityCapsManager(capsManager_, client_);
nickResolver_ = new NickResolver(this->jid_.toBare(), xmppRoster_, vcardManager_, mucRegistry_);
diff --git a/Swift/Controllers/MainController.h b/Swift/Controllers/MainController.h
index ef9c79e..8596ace 100644
--- a/Swift/Controllers/MainController.h
+++ b/Swift/Controllers/MainController.h
@@ -29,6 +29,7 @@
namespace Swift {
class AvatarStorage;
+ class CapsStorage;
class VCardStorage;
class VCardManager;
class Application;
@@ -47,6 +48,8 @@ namespace Swift {
class DiscoInfoResponder;
class ApplicationMessageDisplay;
class AvatarManager;
+ class CapsManager;
+ class EntityCapsManager;
class LoginWindow;
class EventLoop;
class SoftwareVersionResponder;
@@ -82,6 +85,7 @@ namespace Swift {
ChatListWindowFactory* chatListWindowFactory_,
MUCSearchWindowFactory* mucSearchWindowFactory,
AvatarStorage* avatarStorage,
+ CapsStorage* capsStorage,
VCardStorageFactory* vcardStorageFactory,
ApplicationMessageDisplay* applicationMessageDisplay,
bool useDelayForLatency);
@@ -126,6 +130,7 @@ namespace Swift {
SettingsProvider *settings_;
ProfileSettingsProvider* profileSettings_;
AvatarStorage* avatarStorage_;
+ CapsStorage* capsStorage_;
VCardStorageFactory* vcardStorageFactory_;
VCardManager* vcardManager_;
ApplicationMessageDisplay* applicationMessageDisplay_;
@@ -149,6 +154,8 @@ namespace Swift {
SystemTrayController* systemTrayController_;
SoundEventController* soundEventController_;
AvatarManager* avatarManager_;
+ CapsManager* capsManager_;
+ EntityCapsManager* entityCapsManager_;
String vCardPhotoHash_;
String password_;
String certificateFile_;