From 4529adfa0ed7e69ffc3729144cd07c9a482f150f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20P=C3=B6sel?= Date: Sun, 4 Sep 2016 14:05:03 +0000 Subject: Facebook: Fix sometimes wrongly identified users as friends Also fixes related problem when it was showing "user was removed from server list" popup even when user was never your friend (due to problem above). git-svn-id: http://svn.miranda-ng.org/main/trunk@17252 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/FacebookRM/src/json.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'protocols/FacebookRM/src/json.cpp') diff --git a/protocols/FacebookRM/src/json.cpp b/protocols/FacebookRM/src/json.cpp index 80ee795daa..720a842da8 100644 --- a/protocols/FacebookRM/src/json.cpp +++ b/protocols/FacebookRM/src/json.cpp @@ -32,19 +32,19 @@ void parseUser(const JSONNode &it, facebook_user *fbu) std::string thumbSrc = it["thumbSrc"].as_string(); std::string vanity = it["vanity"].as_string(); // username std::string type = it["type"].as_string(); // "friend", "page", "user" (friend with disabled account or not friend) + bool isFriend = it["is_friend"].as_bool(); // e.g. "True" or "False" for type="friend" (I don't know why), "False" for type="user", doesn't exist for type="page" int gender = it["gender"].as_int(); - //const JSONNode &uri = it["uri"); // profile url - //const JSONNode &is_friend = it["is_friend"); // e.g. "True" for type="friend", "False" for type="user", doesn't exist for type="page" + //const JSONNode &uri = it["uri"); // profile url if (type == "user" && (id.empty() || id == "0")) { // this user has deleted account or is just unavailable for us (e.g., ignore list) -> don't read dummy name and avatar and rather ignore that completely return; } - if (type == "friend") + if (type == "friend" && isFriend) fbu->type = CONTACT_FRIEND; - else if (type == "user") + else if (type == "user" || (type == "friend" && !isFriend)) fbu->type = CONTACT_NONE; else if (type == "page") fbu->type = CONTACT_PAGE; -- cgit v1.2.3