summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Swiften/Client/Client.cpp1
-rw-r--r--Swiften/Disco/ClientDiscoManager.cpp4
-rw-r--r--Swiften/Disco/ClientDiscoManager.h7
3 files changed, 12 insertions, 0 deletions
diff --git a/Swiften/Client/Client.cpp b/Swiften/Client/Client.cpp
index 48eddc2..4d3ee04 100644
--- a/Swiften/Client/Client.cpp
+++ b/Swiften/Client/Client.cpp
@@ -110,18 +110,19 @@ void Client::setSoftwareVersion(const std::string& name, const std::string& vers
softwareVersionResponder->setVersion(name, version, os);
}
void Client::handleConnected() {
#ifdef SWIFT_EXPERIMENTAL_FT
fileTransferManager = new FileTransferManagerImpl(getJID(), jingleSessionManager, getIQRouter(), getEntityCapsProvider(), presenceOracle, getNetworkFactories()->getConnectionFactory(), getNetworkFactories()->getConnectionServerFactory(), getNetworkFactories()->getTimerFactory(), getNetworkFactories()->getNATTraverser());
#else
fileTransferManager = new DummyFileTransferManager();
#endif
+ discoManager->handleConnected();
}
void Client::requestRoster() {
// FIXME: We should set this once when the session is finished, but there
// is currently no callback for this
if (getSession()) {
rosterController->setUseVersioning(getSession()->getRosterVersioningSupported());
}
rosterController->requestRoster();
diff --git a/Swiften/Disco/ClientDiscoManager.cpp b/Swiften/Disco/ClientDiscoManager.cpp
index 99c0175..cca0144 100644
--- a/Swiften/Disco/ClientDiscoManager.cpp
+++ b/Swiften/Disco/ClientDiscoManager.cpp
@@ -30,10 +30,14 @@ void ClientDiscoManager::setCapsNode(const std::string& node) {
void ClientDiscoManager::setDiscoInfo(const DiscoInfo& discoInfo) {
capsInfo = CapsInfo::ref(new CapsInfo(CapsInfoGenerator(capsNode).generateCapsInfo(discoInfo)));
discoInfoResponder->clearDiscoInfo();
discoInfoResponder->setDiscoInfo(discoInfo);
discoInfoResponder->setDiscoInfo(capsInfo->getNode() + "#" + capsInfo->getVersion(), discoInfo);
presenceSender->setPayload(capsInfo);
}
+void ClientDiscoManager::handleConnected() {
+ presenceSender->reset();
+}
+
}
diff --git a/Swiften/Disco/ClientDiscoManager.h b/Swiften/Disco/ClientDiscoManager.h
index f8ba9ac..6f126eb 100644
--- a/Swiften/Disco/ClientDiscoManager.h
+++ b/Swiften/Disco/ClientDiscoManager.h
@@ -52,16 +52,23 @@ namespace Swift {
* Returns the presence sender through which all outgoing presence
* should be sent.
* The manager will add the necessary caps information, and forward it to
* the presence sender passed at construction time.
*/
PresenceSender* getPresenceSender() const {
return presenceSender;
}
+ /**
+ * Called when the client is connected.
+ * This resets the presence sender, such that it assumes initial presence
+ * hasn't been sent yet.
+ */
+ void handleConnected();
+
private:
PayloadAddingPresenceSender* presenceSender;
DiscoInfoResponder* discoInfoResponder;
std::string capsNode;
CapsInfo::ref capsInfo;
};
}