summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2019-06-17 20:14:39 +0300
committerGeorge Hazan <ghazan@miranda.im>2019-06-17 20:14:39 +0300
commite49424a51bc3fbb0ccb2d1ecafec3f4fe3689930 (patch)
treebf6f56bc879079006b52b20cdb9dfbe078bba33d /protocols
parentaf43255d4511c6fcff3ddd07b9c21f3d9ca51bb9 (diff)
flicker free version of previous patch
Diffstat (limited to 'protocols')
-rw-r--r--protocols/FacebookRM/src/json.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/protocols/FacebookRM/src/json.cpp b/protocols/FacebookRM/src/json.cpp
index b6d4797e56..4901848b7d 100644
--- a/protocols/FacebookRM/src/json.cpp
+++ b/protocols/FacebookRM/src/json.cpp
@@ -1205,20 +1205,23 @@ int FacebookProto::ParseBuddylistUpdate(std::string* data)
if (!buddylist)
return EXIT_FAILURE;
- setAllContactStatuses(ID_STATUS_OFFLINE);
-
+ std::map<MCONTACT, bool> list;
+
for (auto &it : buddylist) {
const JSONNode &id = it["id"];
- const JSONNode &status = it["status"];
// Facebook now sends info also about some nonfriends, so we just ignore status change of contacts we don't have in list
MCONTACT hContact = ContactIDToHContact(id.as_string());
- if (!hContact)
- continue;
-
- setWord(hContact, "Status", ID_STATUS_ONLINE);
+ if (hContact) {
+ setWord(hContact, "Status", ID_STATUS_ONLINE);
+ list.insert(std::pair<MCONTACT, bool>(hContact, true));
+ }
}
+ for (auto &it : AccContacts())
+ if (list.find(it) == list.end())
+ setWord(it, "Status", ID_STATUS_OFFLINE);
+
return EXIT_SUCCESS;
}