From c3476b0dd031a7b85baa138c84e7d5751d67dbf5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20P=C3=B6sel?= Date: Sun, 4 Dec 2016 17:49:27 +0100 Subject: Facebook: Fix support for "new" group chats (dirty changes) This commit is just quick workaround for group chat changes, where Facebook stopped using "id.XXX" ids, and instead use just "XXX" fbids. And for old existing chats tolerates old type, but for new forces this new format. I don't know how that, or changes in this commit, affects classic conversations, but in any case this commit should be cleaned and integrated better. Perhaps rewrite whole uses of "ids" to "fbids" everywhere. --- protocols/FacebookRM/src/requests/messages.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'protocols/FacebookRM/src/requests/messages.h') diff --git a/protocols/FacebookRM/src/requests/messages.h b/protocols/FacebookRM/src/requests/messages.h index bc6c41784d..d2e468a6f9 100644 --- a/protocols/FacebookRM/src/requests/messages.h +++ b/protocols/FacebookRM/src/requests/messages.h @@ -146,7 +146,12 @@ public: << "__a=1"; for (int i = 0; i < ids.getCount(); i++) { - CMStringA id(::FORMAT, "ids[%s]=true", ptrA(mir_urlEncode(ids[i]))); + std::string id_ = ids[i]; + // NOTE: Remove "id." prefix as here we need to give threadFbId and not threadId + if (id_.substr(0, 3) == "id.") + id_ = id_.substr(3); + + CMStringA id(::FORMAT, "ids[%s]=true", ptrA(mir_urlEncode(id_.c_str()))); Body << id.c_str(); } -- cgit v1.2.3