From d1ad31696e9c59cbb7389317585e2d1a7a397e94 Mon Sep 17 00:00:00 2001 From: Lance Stout Date: Fri, 25 May 2012 11:04:46 -0700 Subject: Fix X-FACEBOOK-PLATFORM mechanism to work with Python3. --- .../thirdparty/suelta/mechanisms/facebook_platform.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/sleekxmpp/thirdparty/suelta/mechanisms/facebook_platform.py b/sleekxmpp/thirdparty/suelta/mechanisms/facebook_platform.py index cb0f09d5..af6a78eb 100644 --- a/sleekxmpp/thirdparty/suelta/mechanisms/facebook_platform.py +++ b/sleekxmpp/thirdparty/suelta/mechanisms/facebook_platform.py @@ -22,13 +22,17 @@ class X_FACEBOOK_PLATFORM(Mechanism): values[key] = value resp_data = { - b'method': values[b'method'], - b'v': b'1.0', - b'call_id': b'1.0', - b'nonce': values[b'nonce'], - b'access_token': self.values['access_token'], - b'api_key': self.values['api_key'] + 'method': values[b'method'], + 'v': '1.0', + 'call_id': '1.0', + 'nonce': values[b'nonce'], + 'access_token': self.values['access_token'], + 'api_key': self.values['api_key'] } + + for k, v in resp_data.items(): + resp_data[k] = bytes(v).decode('utf-8') + resp = '&'.join(['%s=%s' % (k, v) for k, v in resp_data.items()]) return bytes(resp) return b'' -- cgit v1.2.3