Mercurial > libervia-backend
comparison src/core/sat_main.py @ 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 | 8b116fa42a31 |
children | 626e85e46d7c |
comparison
equal
deleted
inserted
replaced
549:2c5ef983f2ef | 550:f25eef861b43 |
---|---|
114 | 114 |
115 self.bridge=DBusBridge() | 115 self.bridge=DBusBridge() |
116 self.bridge.register("getVersion", lambda: self.get_const('client_version')) | 116 self.bridge.register("getVersion", lambda: self.get_const('client_version')) |
117 self.bridge.register("getProfileName", self.memory.getProfileName) | 117 self.bridge.register("getProfileName", self.memory.getProfileName) |
118 self.bridge.register("getProfilesList", self.memory.getProfilesList) | 118 self.bridge.register("getProfilesList", self.memory.getProfilesList) |
119 self.bridge.register("getEntityData", lambda _jid, keys, profile: self.memory.getEntityData(jid.JID(_jid),keys, profile)) | 119 self.bridge.register("getEntityData", lambda _jid, keys, profile: self.memory.getEntityData(jid.JID(_jid), keys, profile)) |
120 self.bridge.register("createProfile", self.memory.createProfile) | 120 self.bridge.register("createProfile", self.memory.createProfile) |
121 self.bridge.register("asyncCreateProfile", self.memory.asyncCreateProfile) | 121 self.bridge.register("asyncCreateProfile", self.memory.asyncCreateProfile) |
122 self.bridge.register("deleteProfile", self.memory.deleteProfile) | 122 self.bridge.register("deleteProfile", self.memory.deleteProfile) |
123 self.bridge.register("registerNewAccount", self.registerNewAccount) | 123 self.bridge.register("registerNewAccount", self.registerNewAccount) |
124 self.bridge.register("connect", self.connect) | 124 self.bridge.register("connect", self.connect) |
254 if connected_cb: | 254 if connected_cb: |
255 connected_cb(profile) | 255 connected_cb(profile) |
256 | 256 |
257 current.startService() | 257 current.startService() |
258 | 258 |
259 return current.getConnectionDeferred() | 259 d = current.getConnectionDeferred() |
260 d.addCallback(lambda x: current.roster.got_roster) #we want to be sure that we got the roster | |
261 return d | |
260 | 262 |
261 self.memory.startProfileSession(profile) | 263 self.memory.startProfileSession(profile) |
262 return self.memory.loadIndividualParams(profile).addCallback(afterMemoryInit) | 264 return self.memory.loadIndividualParams(profile).addCallback(afterMemoryInit) |
263 | 265 |
264 def disconnect(self, profile_key): | 266 def disconnect(self, profile_key): |