From dc1d158059d55884e7243581347ff118e5770db2 Mon Sep 17 00:00:00 2001 From: Tom McAdam Date: Fri, 5 May 2017 17:03:21 +0900 Subject: [PATCH] Fix for getUserInfo method throwing an error The participants property on thread object is return a list of unicodes. If you then pass these unicodes to getUserInfo, they are not being picked up in the if statement on line 905 in the fbidStrip method, so the fbidStrip method was returning a tuple of None objects. The conditional now matches and reformats both str and unicode objects. --- fbchat/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fbchat/client.py b/fbchat/client.py index 0595db3..fd74a20 100644 --- a/fbchat/client.py +++ b/fbchat/client.py @@ -902,7 +902,7 @@ class Client(object): if type(_fbid) == int: return _fbid - if type(_fbid) == str and 'fbid:' in _fbid: + if type(_fbid) in [str, unicode] and 'fbid:' in _fbid: return int(_fbid[5:]) user_ids = [fbidStrip(uid) for uid in user_ids]