changeset 550:f25eef861b43

core: asyncConnect is now fired when roster is available
author Goffi <goffi@goffi.org>
date Thu, 22 Nov 2012 00:46:00 +0100
parents 2c5ef983f2ef
children dcec4ba8e72c
files src/core/sat_main.py
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/core/sat_main.py	Thu Nov 22 00:44:56 2012 +0100
+++ b/src/core/sat_main.py	Thu Nov 22 00:46:00 2012 +0100
@@ -116,7 +116,7 @@
         self.bridge.register("getVersion", lambda: self.get_const('client_version'))
         self.bridge.register("getProfileName", self.memory.getProfileName)
         self.bridge.register("getProfilesList", self.memory.getProfilesList)
-        self.bridge.register("getEntityData", lambda _jid, keys, profile: self.memory.getEntityData(jid.JID(_jid),keys, profile))
+        self.bridge.register("getEntityData", lambda _jid, keys, profile: self.memory.getEntityData(jid.JID(_jid), keys, profile))
         self.bridge.register("createProfile", self.memory.createProfile)
         self.bridge.register("asyncCreateProfile", self.memory.asyncCreateProfile)
         self.bridge.register("deleteProfile", self.memory.deleteProfile)
@@ -256,7 +256,9 @@
 
             current.startService()
 
-            return current.getConnectionDeferred()
+            d = current.getConnectionDeferred()
+            d.addCallback(lambda x: current.roster.got_roster) #we want to be sure that we got the roster
+            return d
 
         self.memory.startProfileSession(profile)
         return self.memory.loadIndividualParams(profile).addCallback(afterMemoryInit)