quick frontend: asyncConnect is now used, to be sure that roster is available before continuing profile plugging

This commit is contained in:
Goffi 2012-12-19 23:22:10 +01:00
commit faac62cfd2

View file

@ -149,8 +149,11 @@ class QuickApp(object):
def plug_profile_4(self, watched, autoconnect, profile):
if autoconnect and not self.bridge.isConnected(profile):
#Does the user want autoconnection ?
self.bridge.connect(profile)
self.bridge.asyncConnect(profile, callback=lambda: self.plug_profile_5(watched, autoconnect, profile), errback=lambda ignore: error(_('Error during autoconnection')))
else:
self.plug_profile_5(watched, autoconnect, profile)
def plug_profile_5(self, watched, autoconnect, profile):
self.profiles[profile]['watched'] = watched.split() #TODO: put this in a plugin
## misc ##