summaryrefslogtreecommitdiff
path: root/protocols/FacebookRM/src
diff options
context:
space:
mode:
authorRobert Pösel <robyer@seznam.cz>2015-11-01 21:38:16 +0000
committerRobert Pösel <robyer@seznam.cz>2015-11-01 21:38:16 +0000
commit29bda224e84d94a52005a91442305e8a12f914a1 (patch)
treeae9e3ff9f8b4fdb59547852794a0b5c81a822dc8 /protocols/FacebookRM/src
parent84068f2a81d55e17b846ea6a515a304692dd3787 (diff)
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
Diffstat (limited to 'protocols/FacebookRM/src')
-rw-r--r--protocols/FacebookRM/src/json.cpp8
1 files changed, 5 insertions, 3 deletions
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) {