[Telepathy-commits] [telepathy-qt4/master] Connection: Fixed becomeReady.

Andre Moreira Magalhaes (andrunko) andre.magalhaes at collabora.co.uk
Mon Jan 26 12:29:54 PST 2009


Fixed becomeReady to set the presence to available if we are connected and we
asked for FeatureSelfPresence.
---
 TelepathyQt4/Client/connection.cpp |   17 +++++++++++------
 1 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/TelepathyQt4/Client/connection.cpp b/TelepathyQt4/Client/connection.cpp
index 86105c6..c39e936 100644
--- a/TelepathyQt4/Client/connection.cpp
+++ b/TelepathyQt4/Client/connection.cpp
@@ -1295,17 +1295,22 @@ PendingOperation *Connection::becomeReady(Features requestedFeatures)
             mPriv->interfaces.contains(TELEPATHY_INTERFACE_CONNECTION_INTERFACE_SIMPLE_PRESENCE)) {
             mPriv->introspectQueue.enqueue(&Private::introspectSimplePresence);
 
-            // we still don't have our own presence but as the user
-            // requested for FeatureSelfPresence, change our presence to
-            // offline
-            SimplePresence presence = { Telepathy::ConnectionPresenceTypeOffline, };
-            mPriv->changeSelfPresence(presence);
-
             // we are already connected, so we at least enqueued the call to
             // getSelfHandle and we can enqueue the call to getSelfPresence
             if (mPriv->readiness == Private::ReadinessFull) {
+                // we stiff don't have our own presence but we are online
+                // so set selfPresence to available
+                SimplePresence presence = { Telepathy::ConnectionPresenceTypeAvailable, };
+                mPriv->changeSelfPresence(presence);
                 mPriv->introspectQueue.enqueue(&Private::introspectSelfPresence);
             }
+            else {
+                // we still don't have our own presence but as the user
+                // requested for FeatureSelfPresence, change our presence to
+                // offline
+                SimplePresence presence = { Telepathy::ConnectionPresenceTypeOffline, };
+                mPriv->changeSelfPresence(presence);
+            }
 
             QTimer::singleShot(0, this, SLOT(continueIntrospection()));
         }
-- 
1.5.6.5




More information about the Telepathy-commits mailing list