summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
authorRobert Pösel <robyer@seznam.cz>2017-05-07 15:00:19 +0200
committerRobert Pösel <robyer@seznam.cz>2017-05-07 15:00:33 +0200
commite04d28cfcfe33f0450b390bb1af6e9df823fc86a (patch)
tree6c0eea76a7bfe75ffdc3eb94db88ed59dc876180 /protocols
parentff6a107e5f566da2644fbfe36455467beafaeb1e (diff)
Facebook: Ignore typing nofitications meant not for us (but e.g. for our page)
Diffstat (limited to 'protocols')
-rw-r--r--protocols/FacebookRM/src/json.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/protocols/FacebookRM/src/json.cpp b/protocols/FacebookRM/src/json.cpp
index 3c1602d593..90ed0dd3cf 100644
--- a/protocols/FacebookRM/src/json.cpp
+++ b/protocols/FacebookRM/src/json.cpp
@@ -783,12 +783,13 @@ int facebook_json_parser::parse_messages(std::string *pData, std::vector<faceboo
else if (t == "typ") { // revised 5.3.2017
// chat typing notification
const JSONNode &from_ = (*it)["from"]; // user fbid
- //const JSONNode &to_ = (*it)["to"]; // user fbid (should be our own)
+ const JSONNode &to_ = (*it)["to"]; // user fbid (should be our own, but could be from our page too)
//const JSONNode &realtime_viewer_fbid_ = (*it)["realtime_viewer_fbid"]; // our user fbid
//const JSONNode &from_mobile_ = (*it)["from_mobile"]; // boolean // TODO: perhaps we should update user client based on this?
const JSONNode &st_ = (*it)["st"]; // typing status - 1 = started typing, 0 = stopped typing
- if (!from_)
+ // Ignore wrong (without "from") typing notifications or that are not meant for us (but e.g. for our page)
+ if (!from_ || to_.as_string() == proto->facy.self_.user_id)
continue;
facebook_user fbu;