Make get_roster(block=False) work properly.

Fixes issue #136
This commit is contained in:
Lance Stout 2012-01-10 19:57:38 -08:00
parent 6b9a55e62d
commit a86935a42f

View file

@ -237,9 +237,13 @@ class ClientXMPP(BaseXMPP):
iq = self.Iq() iq = self.Iq()
iq['type'] = 'get' iq['type'] = 'get'
iq.enable('roster') iq.enable('roster')
if not block and callback is None:
callback = lambda resp: self._handle_roster(resp, request=True)
response = iq.send(block, timeout, callback) response = iq.send(block, timeout, callback)
if callback is None: if block:
return self._handle_roster(response, request=True) return self._handle_roster(response, request=True)
def _handle_connected(self, event=None): def _handle_connected(self, event=None):