summaryrefslogtreecommitdiff
path: root/protocols/FacebookRM/src/messages.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-01-08 22:25:39 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-01-08 22:25:39 +0300
commit1e5ae8efefc6f50082c1c1734c763aab2fb1b7f5 (patch)
tree3c6988ab32b6458289a830d7bf544a8357119246 /protocols/FacebookRM/src/messages.cpp
parent2f058ad0b6a6df7074f5ca05b37b8f4717d9eb13 (diff)
adds support for exiting groupchats
Diffstat (limited to 'protocols/FacebookRM/src/messages.cpp')
-rw-r--r--protocols/FacebookRM/src/messages.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/protocols/FacebookRM/src/messages.cpp b/protocols/FacebookRM/src/messages.cpp
index 5957cf4ba7..794225de2a 100644
--- a/protocols/FacebookRM/src/messages.cpp
+++ b/protocols/FacebookRM/src/messages.cpp
@@ -343,3 +343,35 @@ HttpRequest* facebook_client::markMessageReadRequest(const LIST<char> &ids)
return p;
}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
+HttpRequest* facebook_client::exitThreadRequest(facebook_chatroom *fbc)
+{
+ HttpRequest *p = new HttpRequest(REQUEST_POST, FACEBOOK_SERVER_REGULAR "/messaging/send/");
+
+ p->Url << INT_PARAM("dpr", 1);
+
+ std::string msgid = utils::text::rand_string(15);
+
+ p->Body
+ << CHAR_PARAM("client", "mercury")
+ << CHAR_PARAM("action_type", "ma-type:log-message")
+ << CHAR_PARAM("log_message_data[removed_participants][0]", ("fbid:" + self_.user_id).c_str())
+ << CHAR_PARAM("log_message_type", "log:unsubscribe")
+ << CHAR_PARAM("message_id", msgid.c_str())
+ << CHAR_PARAM("offline_threading_id", msgid.c_str())
+ << CHAR_PARAM("source", "source:chat:web")
+ << CHAR_PARAM("thread_fbid", fbc->thread_id.substr(3).c_str())
+ << CHAR_PARAM("fb_dtsg", dtsg_.c_str())
+ << INT64_PARAM("timestamp", ::time(nullptr) * 1000)
+ << CHAR_PARAM("__user", self_.user_id.c_str())
+ << CHAR_PARAM("__dyn", __dyn())
+ << CHAR_PARAM("__req", __req())
+ << CHAR_PARAM("__rev", __rev())
+ << CHAR_PARAM("__pc", "PHASED:DEFAULT")
+ << INT_PARAM("__a", 1)
+ << INT_PARAM("__be", 1);
+
+ return p;
+}