Send read receipts asynchronously. Hopefully fixes #141
This commit is contained in:
parent
3b5840bb06
commit
f9007ae875
@ -795,8 +795,13 @@ func (c *Container) HandleTyping(_ EventSource, evt *event.Event) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *Container) MarkRead(roomID id.RoomID, eventID id.EventID) {
|
func (c *Container) MarkRead(roomID id.RoomID, eventID id.EventID) {
|
||||||
urlPath := c.client.BuildURL("rooms", roomID, "receipt", "m.read", eventID)
|
go func() {
|
||||||
_, _ = c.client.MakeRequest("POST", urlPath, struct{}{}, nil)
|
defer debug.Recover()
|
||||||
|
err := c.client.MarkRead(roomID, eventID)
|
||||||
|
if err != nil {
|
||||||
|
debug.Print("Failed to mark %s in %s as read: %v", eventID, roomID, err)
|
||||||
|
}
|
||||||
|
}()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Container) PrepareMarkdownMessage(roomID id.RoomID, msgtype event.MessageType, text, html string, rel *ifc.Relation) *muksevt.Event {
|
func (c *Container) PrepareMarkdownMessage(roomID id.RoomID, msgtype event.MessageType, text, html string, rel *ifc.Relation) *muksevt.Event {
|
||||||
|
Loading…
Reference in New Issue
Block a user