From 29bda224e84d94a52005a91442305e8a12f914a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20P=C3=B6sel?= Date: Sun, 1 Nov 2015 21:38:16 +0000 Subject: Facebook: Fix setting contacts' status "on the phone" with new version of Facebook In new version Facebook stopped sending "p" json element with info about client user is connected with. Without that info, we won't have correct MirVer anymore (now setting website by default). But there is still element which say what contacts are "on mobile" so now we use that correctly. git-svn-id: http://svn.miranda-ng.org/main/trunk@15665 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/FacebookRM/src/json.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'protocols') diff --git a/protocols/FacebookRM/src/json.cpp b/protocols/FacebookRM/src/json.cpp index cc48d8c3f6..4a84213eea 100644 --- a/protocols/FacebookRM/src/json.cpp +++ b/protocols/FacebookRM/src/json.cpp @@ -35,9 +35,11 @@ int facebook_json_parser::parse_buddy_list(std::string *data, List::List< facebo if (!list) return EXIT_FAILURE; - // Set all contacts in map to offline - for (List::Item< facebook_user >* i = buddy_list->begin(); i != NULL; i = i->next) + // Set all contacts in map to offline (and reset client) + for (List::Item< facebook_user >* i = buddy_list->begin(); i != NULL; i = i->next) { i->data->status_id = ID_STATUS_OFFLINE; + i->data->client = CLIENT_WEB; + } // Load last active times const JSONNode &lastActive = list["last_active_times"]; @@ -82,7 +84,7 @@ int facebook_json_parser::parse_buddy_list(std::string *data, List::List< facebo current->user_id = id; } - current->status_id = ID_STATUS_ONLINE; + current->status_id = (current->client == CLIENT_MOBILE) ? ID_STATUS_ONTHEPHONE : ID_STATUS_ONLINE; const JSONNode &p = (*it)["p"]; if (p) { -- cgit v1.2.3