From cebe7a28c081adaccbc739ecccc33187b0be1f97 Mon Sep 17 00:00:00 2001 From: 2FWAH <36737818+2FWAH@users.noreply.github.com> Date: Fri, 1 Jun 2018 12:57:09 +0200 Subject: [PATCH] Fix onTyping detection FB changed the format of typing notification messages: - update "mtype" from "typ" to "ttyp". - Get thread ID from "to" to "thread_fbid" ("thread" looks the same) --- fbchat/client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fbchat/client.py b/fbchat/client.py index 2b20d69..ae1af9e 100644 --- a/fbchat/client.py +++ b/fbchat/client.py @@ -1529,9 +1529,9 @@ class Client(object): self.onInbox(unseen=m["unseen"], unread=m["unread"], recent_unread=m["recent_unread"], msg=m) # Typing - elif mtype == "typ": + elif mtype == "ttyp": author_id = str(m.get("from")) - thread_id = str(m.get("to")) + thread_id = str(m.get("thread_fbid")) if thread_id == self.uid: thread_type = ThreadType.USER else: