Mark events as read

master
Robert Jacob 2022-03-21 23:41:06 +01:00
parent 4f3049554a
commit 92da735ab9
1 changed files with 11 additions and 0 deletions

11
main.go
View File

@ -113,6 +113,17 @@ func main() {
if err := r.PushEvent(timeStamp, id); err != nil {
log.Errorf("Error pushing event to ruler: %s", err)
return
}
// Using MarkRead from the client library results in an error ("content not JSON")
// TODO revert to using MarkRead once fixed in library
urlPath := client.BuildURL("rooms", evt.RoomID, "receipt", "m.read", evt.ID)
if err := client.MakeRequest(http.MethodPost, urlPath, struct{}{}, nil); err != nil {
log.WithFields(logrus.Fields{
"event": evt.ID,
"room": evt.RoomID,
}).WithError(err).Error("Can not mark event as read.")
}
}