From 758809172f32dfe41d78dbbec19a7b24179fa27f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20P=C3=B6sel?= Date: Mon, 23 Jan 2017 01:22:06 +0100 Subject: Facebook: Fix loading offline messages --- protocols/FacebookRM/src/json.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'protocols/FacebookRM') diff --git a/protocols/FacebookRM/src/json.cpp b/protocols/FacebookRM/src/json.cpp index d577fb882c..e559f982f8 100644 --- a/protocols/FacebookRM/src/json.cpp +++ b/protocols/FacebookRM/src/json.cpp @@ -1089,9 +1089,14 @@ int facebook_json_parser::parse_unread_threads(std::string *data, std::vector< s return EXIT_FAILURE; for (auto it = unread_threads.begin(); it != unread_threads.end(); ++it) { - const JSONNode &thread_ids = (*it)["thread_fbids"]; + // For multi user chats + const JSONNode &thread_fbids = (*it)["thread_fbids"]; + for (auto jt = thread_fbids.begin(); jt != thread_fbids.end(); ++jt) + threads->push_back((*jt).as_string()); - for (auto jt = thread_ids.begin(); jt != thread_ids.end(); ++jt) + // For classic conversations + const JSONNode &other_user_fbids = (*it)["other_user_fbids"]; + for (auto jt = other_user_fbids.begin(); jt != other_user_fbids.end(); ++jt) threads->push_back((*jt).as_string()); } -- cgit v1.2.3