summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2010-10-23 21:08:19 (GMT)
committerRemko Tronçon <git@el-tramo.be>2010-11-03 12:17:40 (GMT)
commit9d9fb66aefef85a1c5ad432391014d15011747d1 (patch)
tree55b1ebe7dcb0108008a28ebf8fee773b27e60547 /Swiften/Client
parentd509598b0f0edf5e103caedbab8662edc834445e (diff)
downloadswift-9d9fb66aefef85a1c5ad432391014d15011747d1.zip
swift-9d9fb66aefef85a1c5ad432391014d15011747d1.tar.bz2
Added ClientDiscoManager.
Diffstat (limited to 'Swiften/Client')
-rw-r--r--Swiften/Client/Client.cpp5
-rw-r--r--Swiften/Client/Client.h6
-rw-r--r--Swiften/Client/DummyStanzaChannel.h4
3 files changed, 14 insertions, 1 deletions
diff --git a/Swiften/Client/Client.cpp b/Swiften/Client/Client.cpp
index 7dbcb70..fd01e25 100644
--- a/Swiften/Client/Client.cpp
+++ b/Swiften/Client/Client.cpp
@@ -20,6 +20,7 @@
#include "Swiften/Avatars/AvatarManagerImpl.h"
#include "Swiften/Disco/CapsManager.h"
#include "Swiften/Disco/EntityCapsManager.h"
+#include "Swiften/Disco/ClientDiscoManager.h"
#include "Swiften/Client/NickResolver.h"
#include "Swiften/Presence/SubscriptionManager.h"
@@ -41,6 +42,7 @@ Client::Client(EventLoop* eventLoop, const JID& jid, const String& password, Sto
stanzaChannelPresenceSender = new StanzaChannelPresenceSender(getStanzaChannel());
directedPresenceSender = new DirectedPresenceSender(stanzaChannelPresenceSender);
+ discoManager = new ClientDiscoManager(getIQRouter(), directedPresenceSender);
mucRegistry = new MUCRegistry();
mucManager = new MUCManager(getStanzaChannel(), getIQRouter(), directedPresenceSender, mucRegistry);
@@ -64,6 +66,7 @@ Client::~Client() {
delete mucManager;
delete mucRegistry;
+ delete discoManager;
delete directedPresenceSender;
delete stanzaChannelPresenceSender;
@@ -106,7 +109,7 @@ Storages* Client::getStorages() const {
}
PresenceSender* Client::getPresenceSender() const {
- return directedPresenceSender;
+ return discoManager->getPresenceSender();
}
}
diff --git a/Swiften/Client/Client.h b/Swiften/Client/Client.h
index adfd549..a17fe24 100644
--- a/Swiften/Client/Client.h
+++ b/Swiften/Client/Client.h
@@ -27,6 +27,7 @@ namespace Swift {
class EntityCapsManager;
class NickResolver;
class SubscriptionManager;
+ class ClientDiscoManager;
/**
* Provides the core functionality for writing XMPP client software.
@@ -122,6 +123,10 @@ namespace Swift {
return subscriptionManager;
}
+ ClientDiscoManager* getDiscoManager() const {
+ return discoManager;
+ }
+
public:
/**
* This signal is emitted when a JID changes presence.
@@ -151,5 +156,6 @@ namespace Swift {
NickResolver* nickResolver;
SubscriptionManager* subscriptionManager;
MUCManager* mucManager;
+ ClientDiscoManager* discoManager;
};
}
diff --git a/Swiften/Client/DummyStanzaChannel.h b/Swiften/Client/DummyStanzaChannel.h
index b8ae545..d9fb138 100644
--- a/Swiften/Client/DummyStanzaChannel.h
+++ b/Swiften/Client/DummyStanzaChannel.h
@@ -56,6 +56,10 @@ namespace Swift {
return iqStanza && iqStanza->getType() == type && iqStanza->getTo() == jid && iqStanza->getPayload<T>();
}
+ template<typename T> boost::shared_ptr<T> getStanzaAtIndex(size_t index) {
+ return boost::dynamic_pointer_cast<T>(sentStanzas[index]);
+ }
+
std::vector<boost::shared_ptr<Stanza> > sentStanzas;
bool available_;
};