Skip to content
Snippets Groups Projects
Unverified Commit 6b522aee authored by Nicolas Werner's avatar Nicolas Werner Committed by GitHub
Browse files

Merge pull request #72 from symphorien/hidden-read-receipts

add support for hidden read receipts
parents d6953901 67983810
No related branches found
No related tags found
No related merge requests found
Pipeline #2680 passed
......@@ -435,7 +435,10 @@ public:
void versions(Callback<mtx::responses::Versions> cb);
//! Mark an event as read.
void read_event(const std::string &room_id, const std::string &event_id, ErrCallback cb);
void read_event(const std::string &room_id,
const std::string &event_id,
ErrCallback cb,
bool hidden = false);
//! Redact an event from a room.
void redact_event(const std::string &room_id,
......
......@@ -909,12 +909,16 @@ Client::upload_filter(const nlohmann::json &j, Callback<mtx::responses::FilterId
}
void
Client::read_event(const std::string &room_id, const std::string &event_id, ErrCallback callback)
Client::read_event(const std::string &room_id,
const std::string &event_id,
ErrCallback callback,
bool hidden)
{
const auto api_path =
"/client/r0/rooms/" + mtx::client::utils::url_encode(room_id) + "/read_markers";
nlohmann::json body = {{"m.fully_read", event_id}, {"m.read", event_id}};
nlohmann::json body = {
{"m.fully_read", event_id}, {"m.read", event_id}, {"org.matrix.msc2285.hidden", hidden}};
post<nlohmann::json, mtx::responses::Empty>(
api_path,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment