diff options
author | Robert Pösel <robyer@seznam.cz> | 2015-09-05 06:29:47 +0000 |
---|---|---|
committer | Robert Pösel <robyer@seznam.cz> | 2015-09-05 06:29:47 +0000 |
commit | 8527a46feb7089912c124a9d797be14fcc429545 (patch) | |
tree | 64dfb41f100e36dd26236c5a8ecd21c8edb47f98 /protocols | |
parent | 7dd99119fa425fd517bcf543d7027e0e10f774b6 (diff) |
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
Diffstat (limited to 'protocols')
-rw-r--r-- | protocols/FacebookRM/src/json.cpp | 8 |
1 files 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<std::string, std::string> 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<std::string, facebook_chatroom*>::iterator iter = chatrooms->find(tid); |