From d9afe7697ba309f6d78b61adea474942c0b55424 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20P=C3=B6sel?= Date: Tue, 19 Nov 2013 19:18:00 +0000 Subject: Facebook: distinguish more types of clients and don't reset old client at login/logoff git-svn-id: http://svn.miranda-ng.org/main/trunk@6940 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/FacebookRM/src/json.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'protocols/FacebookRM/src/json.cpp') diff --git a/protocols/FacebookRM/src/json.cpp b/protocols/FacebookRM/src/json.cpp index a103a6f29c..84e7b46abf 100644 --- a/protocols/FacebookRM/src/json.cpp +++ b/protocols/FacebookRM/src/json.cpp @@ -81,7 +81,7 @@ int facebook_json_parser::parse_buddy_list(void* data, List::List< facebook_user } current->status_id = ID_STATUS_OFFLINE; - current->mobile = true; + current->client = CLIENT_MOBILE; } } @@ -113,16 +113,18 @@ int facebook_json_parser::parse_buddy_list(void* data, List::List< facebook_user if (json_as_pstring(status) != "active") current->status_id = ID_STATUS_OFFLINE; + bool b; + // "webStatus" and "otherStatus" are marked as "WEB" on FB website - if (json_as_pstring(webStatus) == "active" || json_as_pstring(otherStatus) == "active") { - current->status_id = ID_STATUS_ONLINE; - current->mobile = false; + if ((b = json_as_pstring(webStatus) == "active") || json_as_pstring(otherStatus) == "active") { + current->status_id = ID_STATUS_ONLINE; + current->client = b ? CLIENT_WEB : CLIENT_OTHER; } // "fbAppStatus" and "messengerStatus" are marked as "MOBILE" on FB website - if (json_as_pstring(fbAppStatus) == "active" || json_as_pstring(messengerStatus) == "active") { + if ((b = json_as_pstring(fbAppStatus) == "active") || json_as_pstring(messengerStatus) == "active") { current->status_id = ID_STATUS_ONTHEPHONE; - current->mobile = true; + current->client = b ? CLIENT_APP : CLIENT_MESSENGER; } // this is not marked anyhow on website (yet?) -- cgit v1.2.3