diff options
author | Lance Stout <lancestout@gmail.com> | 2012-01-10 19:57:38 -0800 |
---|---|---|
committer | Lance Stout <lancestout@gmail.com> | 2012-01-10 19:57:38 -0800 |
commit | a86935a42fba7ed3f944c58975c15a4cb79bbec0 (patch) | |
tree | b33589b9d5d8c43d25bc0d34a442f3256d1a41fe | |
parent | 6b9a55e62d04d334cde2d90d19dad8dc4919c0b5 (diff) | |
download | slixmpp-a86935a42fba7ed3f944c58975c15a4cb79bbec0.tar.gz slixmpp-a86935a42fba7ed3f944c58975c15a4cb79bbec0.tar.bz2 slixmpp-a86935a42fba7ed3f944c58975c15a4cb79bbec0.tar.xz slixmpp-a86935a42fba7ed3f944c58975c15a4cb79bbec0.zip |
Make get_roster(block=False) work properly.
Fixes issue #136
-rw-r--r-- | sleekxmpp/clientxmpp.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sleekxmpp/clientxmpp.py b/sleekxmpp/clientxmpp.py index e3d210ae..36b135d3 100644 --- a/sleekxmpp/clientxmpp.py +++ b/sleekxmpp/clientxmpp.py @@ -237,9 +237,13 @@ class ClientXMPP(BaseXMPP): iq = self.Iq() iq['type'] = 'get' 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) - if callback is None: + if block: return self._handle_roster(response, request=True) def _handle_connected(self, event=None): |