Skip to content
Snippets Groups Projects
Commit 67983810 authored by Guillaume Girol's avatar Guillaume Girol
Browse files

add support for hidden read receipts

parent d6953901
No related branches found
No related tags found
No related merge requests found
Pipeline #2676 passed
...@@ -435,7 +435,10 @@ public: ...@@ -435,7 +435,10 @@ public:
void versions(Callback<mtx::responses::Versions> cb); void versions(Callback<mtx::responses::Versions> cb);
//! Mark an event as read. //! 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. //! Redact an event from a room.
void redact_event(const std::string &room_id, void redact_event(const std::string &room_id,
......
...@@ -909,12 +909,16 @@ Client::upload_filter(const nlohmann::json &j, Callback<mtx::responses::FilterId ...@@ -909,12 +909,16 @@ Client::upload_filter(const nlohmann::json &j, Callback<mtx::responses::FilterId
} }
void 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 = const auto api_path =
"/client/r0/rooms/" + mtx::client::utils::url_encode(room_id) + "/read_markers"; "/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>( post<nlohmann::json, mtx::responses::Empty>(
api_path, 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