# HG changeset patch # User Goffi # Date 1353541496 -3600 # Node ID 2c5ef983f2efcbfcb1eaf47ff4a65463c0032386 # Parent 8022cca26595f22698c506df2f794a891470210f core: client.roster has now a got_roster deferred which is fired when roster is available diff -r 8022cca26595 -r 2c5ef983f2ef src/core/xmpp.py --- a/src/core/xmpp.py Wed Nov 14 21:47:56 2012 +0100 +++ b/src/core/xmpp.py Thu Nov 22 00:44:56 2012 +0100 @@ -133,6 +133,7 @@ def __init__(self, host): xmppim.RosterClientProtocol.__init__(self) self.host = host + self.got_roster = defer.Deferred() #XXX: the two following dicts keep a local copy of the roster self._groups = {} #map from groups to bare jids: key=group value=set of bare jids self._jids = {} #map from bare jids to RosterItem: key=jid value=RosterItem @@ -144,7 +145,8 @@ def requestRoster(self): """ ask the server for Roster list """ debug("requestRoster") - self.getRoster().addCallback(self.rosterCb) + d = self.getRoster().addCallback(self.rosterCb) + d.chainDeferred(self.got_roster) def removeItem(self, to): """Remove a contact from roster list"""