From abb7234475a08089b046b05de7a872d13491539b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20P=C3=B6sel?= Date: Sun, 4 Sep 2016 14:04:58 +0000 Subject: Facebook: Handle unsubscribe events in chat; improve also subscribe event git-svn-id: http://svn.miranda-ng.org/main/trunk@17250 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/FacebookRM/src/json.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'protocols/FacebookRM/src/json.cpp') diff --git a/protocols/FacebookRM/src/json.cpp b/protocols/FacebookRM/src/json.cpp index 71d706a4e1..310a61b0aa 100644 --- a/protocols/FacebookRM/src/json.cpp +++ b/protocols/FacebookRM/src/json.cpp @@ -100,6 +100,14 @@ void parseMessageType(FacebookProto *proto, facebook_message &message, const JSO } else if (logType == "log:unsubscribe") { message.type = UNSUBSCRIBE; + + const JSONNode &fbids_ = log_data_["removed_participants"]; + for (auto it2 = fbids_.begin(); it2 != fbids_.end(); ++it2) { + std::string id = (*it2).as_string().substr(5); // strip "fbid:" prefix + if (!message.data.empty()) + message.data += ";"; + message.data += id; + } } else if (logType == "log:thread-name") { message.type = THREAD_NAME; -- cgit v1.2.3