summaryrefslogtreecommitdiff
path: root/protocols/FacebookRM/src/requests/messages.h
diff options
context:
space:
mode:
authorRobert Pösel <robyer@seznam.cz>2016-12-04 17:49:27 +0100
committerRobert Pösel <robyer@seznam.cz>2016-12-04 17:53:38 +0100
commitc3476b0dd031a7b85baa138c84e7d5751d67dbf5 (patch)
treeb66334136a49beb28acf6dbc685d365554620461 /protocols/FacebookRM/src/requests/messages.h
parentb6c0516b0535f9f4dc14cd4c6ea506762d56cf3e (diff)
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.
Diffstat (limited to 'protocols/FacebookRM/src/requests/messages.h')
-rw-r--r--protocols/FacebookRM/src/requests/messages.h7
1 files changed, 6 insertions, 1 deletions
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();
}