From ac8eb7c62838c7d85f451f2ee0f8456c14386137 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Remko=20Tron=C3=A7on?= Date: Mon, 23 Apr 2012 22:26:02 +0200 Subject: Make sure setting disco info after reconnect does not immediately send presence. Resolves: #976 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 @@ -116,6 +116,7 @@ void Client::handleConnected() { #else fileTransferManager = new DummyFileTransferManager(); #endif + discoManager->handleConnected(); } void Client::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 @@ -36,4 +36,8 @@ void ClientDiscoManager::setDiscoInfo(const DiscoInfo& 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 @@ -58,6 +58,13 @@ namespace Swift { 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; -- cgit v0.10.2-6-g49f6