add read receipts and typing notifications, closes #30

This commit is contained in:
Aine
2022-09-21 11:18:25 +03:00
parent 16c577eeb2
commit c9c871287d
2 changed files with 11 additions and 0 deletions

View File

@@ -7,6 +7,11 @@ import (
func (b *Bot) handle(ctx context.Context) {
evt := eventFromContext(ctx)
err := b.lp.GetClient().MarkRead(evt.RoomID, evt.ID)
if err != nil {
b.log.Error("cannot send read receipt: %v", err)
}
content := evt.Content.AsMessage()
if content == nil {
b.Error(ctx, evt.RoomID, "cannot read message")