diff --git a/include/mtxclient/http/client.hpp b/include/mtxclient/http/client.hpp index 308074bb5587b85755fe69a9e13fa1763d689567..844e1dac8e221eed0968c5701984c639e448ef0b 100644 --- a/include/mtxclient/http/client.hpp +++ b/include/mtxclient/http/client.hpp @@ -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, diff --git a/lib/http/client.cpp b/lib/http/client.cpp index 6170fa1b1c97b20bfc5eb815774f81f2b213ccf1..97d8c157781db35f2abde429aa52f0407c456fe7 100644 --- a/lib/http/client.cpp +++ b/lib/http/client.cpp @@ -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,