summaryrefslogtreecommitdiffstats
path: root/Swift
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
parentebccdadcae24932b299a8612a9c6e0cdc4e00249 (diff)
downloadswift-6f31cc8a329d15767d54511edd14339ac3dfdd7a.zip
swift-6f31cc8a329d15767d54511edd14339ac3dfdd7a.tar.bz2
Added support for Entity Capabilities.
Resolves: #94
Diffstat (limited to 'Swift')
-rw-r--r--Swift/Controllers/MainController.cpp13
-rw-r--r--Swift/Controllers/MainController.h7
-rw-r--r--Swift/QtUI/QtSwift.cpp4
-rw-r--r--Swift/QtUI/QtSwift.h2
4 files changed, 25 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_;
diff --git a/Swift/QtUI/QtSwift.cpp b/Swift/QtUI/QtSwift.cpp
index e1f5e89..e548e29 100644
--- a/Swift/QtUI/QtSwift.cpp
+++ b/Swift/QtUI/QtSwift.cpp
@@ -27,6 +27,7 @@
#include "Swiften/Application/PlatformApplication.h"
#include "Swiften/Application/PlatformApplicationPathProvider.h"
#include "Swiften/Avatars/AvatarFileStorage.h"
+#include "Swiften/Disco/CapsFileStorage.h"
#include "Swiften/VCards/VCardFileStorageFactory.h"
#include "Swiften/Base/String.h"
#include "Swiften/Base/Platform.h"
@@ -84,6 +85,7 @@ QtSwift::QtSwift(po::variables_map options) : autoUpdater_(NULL) {
applicationPathProvider_ = new PlatformApplicationPathProvider(SWIFT_APPLICATION_NAME);
avatarStorage_ = new AvatarFileStorage(applicationPathProvider_->getAvatarDir());
vcardStorageFactory_ = new VCardFileStorageFactory(applicationPathProvider_->getDataDir());
+ capsStorage_ = new CapsFileStorage(applicationPathProvider_->getDataDir() / "caps");
chatWindowFactory_ = new QtChatWindowFactory(splitter_, settings_, tabs_, "");
soundPlayer_ = new QtSoundPlayer(applicationPathProvider_);
if (splitter_) {
@@ -117,6 +119,7 @@ QtSwift::QtSwift(po::variables_map options) : autoUpdater_(NULL) {
chatListWindowFactory,
mucSearchWindowFactory,
avatarStorage_,
+ capsStorage_,
vcardStorageFactory_,
application_->getApplicationMessageDisplay(),
options.count("latency-debug") > 0);
@@ -163,6 +166,7 @@ QtSwift::~QtSwift() {
foreach (QtChatListWindowFactory* factory, chatListWindowFactories_) {
delete factory;
}
+ delete capsStorage_;
delete avatarStorage_;
delete vcardStorageFactory_;
}
diff --git a/Swift/QtUI/QtSwift.h b/Swift/QtUI/QtSwift.h
index a0ea069..4c570ae 100644
--- a/Swift/QtUI/QtSwift.h
+++ b/Swift/QtUI/QtSwift.h
@@ -27,6 +27,7 @@ namespace Swift {
class Application;
class ApplicationPathProvider;
class AvatarStorage;
+ class CapsStorage;
class MainController;
class QtChatWindowFactory;
class QtMainWindowFactory;
@@ -62,6 +63,7 @@ namespace Swift {
Application* application_;
ApplicationPathProvider* applicationPathProvider_;
AvatarStorage* avatarStorage_;
+ CapsStorage* capsStorage_;
VCardStorageFactory* vcardStorageFactory_;
AutoUpdater* autoUpdater_;