Add wrapper for /read_markers endpoint

This commit is contained in:
Tulir Asokan 2022-01-17 22:01:25 +02:00
commit 6d9d537973
2 changed files with 11 additions and 0 deletions

View file

@ -1353,6 +1353,12 @@ func (cli *Client) MarkReadWithContent(roomID id.RoomID, eventID id.EventID, con
return
}
func (cli *Client) SetReadMarkers(roomID id.RoomID, content interface{}) (err error) {
urlPath := cli.BuildURL("rooms", roomID, "read_markers")
_, err = cli.MakeRequest("POST", urlPath, &content, nil)
return
}
func (cli *Client) AddTag(roomID id.RoomID, tag string, order float64) error {
var tagData event.Tag
if order == order {

View file

@ -319,3 +319,8 @@ type ReqBatchSend struct {
StateEventsAtStart []*event.Event `json:"state_events_at_start"`
Events []*event.Event `json:"events"`
}
type ReqSetReadMarkers struct {
Read id.EventID `json:"m.read"`
FullyRead id.EventID `json:"m.fully_read"`
}