Mark events as read

master
Robert Jacob 8 months ago
parent 4f3049554a
commit 92da735ab9
  1. 11
      main.go

@ -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.")
}
}

Loading…
Cancel
Save