From 8527a46feb7089912c124a9d797be14fcc429545 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20P=C3=B6sel?= Date: Sat, 5 Sep 2015 06:29:47 +0000 Subject: Facebook: Fix creating wrongly identified group chats as dummy contacts during history sync at login Problem was caused by expectation that thread_fbid has only classic contacts, but in fact even group chats can have it. Solution is to use other_user_fbid which is null for group chat contacts. git-svn-id: http://svn.miranda-ng.org/main/trunk@15246 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/FacebookRM/src/json.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/protocols/FacebookRM/src/json.cpp b/protocols/FacebookRM/src/json.cpp index 4b4eebb131..cc48d8c3f6 100644 --- a/protocols/FacebookRM/src/json.cpp +++ b/protocols/FacebookRM/src/json.cpp @@ -877,19 +877,19 @@ int facebook_json_parser::parse_thread_messages(std::string *data, std::vector< std::map thread_ids; for (auto it = threads.begin(); it != threads.end(); ++it) { const JSONNode &is_canonical_user = (*it)["is_canonical_user"]; - const JSONNode &thread_fbid = (*it)["thread_fbid"]; // alternatively there is "other_user_fbid" too + const JSONNode &other_user_fbid = (*it)["other_user_fbid"]; // other_user_fbid is better than thread_fbid, because even multi chat has thread_fbid, but they have other_user_fbid=null const JSONNode &thread_id = (*it)["thread_id"]; const JSONNode &name = (*it)["name"]; //const JSONNode &message_count = (*it)["message_count"); //const JSONNode &unread_count = (*it)["unread_count"); // TODO: use it to check against number of loaded messages... but how? const JSONNode &folder = (*it)["folder"]; - if (!thread_fbid || !thread_id) { - proto->debugLogA("!!! Missing thread_fbid/thread_id"); + if (!other_user_fbid || !thread_id) { + proto->debugLogA("!!! Missing other_user_fbid/thread_id"); continue; } - std::string id = thread_fbid.as_string(); + std::string id = other_user_fbid.as_string(); std::string tid = thread_id.as_string(); std::map::iterator iter = chatrooms->find(tid); -- cgit v1.2.3