From a86935a42fba7ed3f944c58975c15a4cb79bbec0 Mon Sep 17 00:00:00 2001 From: Lance Stout Date: Tue, 10 Jan 2012 19:57:38 -0800 Subject: [PATCH] Make get_roster(block=False) work properly. Fixes issue #136 --- sleekxmpp/clientxmpp.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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):