mirror of
https://github.com/tulir/mautrix-whatsapp
synced 2024-12-14 09:23:51 +01:00
Fix handling read receipts where target is unknown
This commit is contained in:
parent
a909750dcc
commit
c55cad980d
1 changed files with 5 additions and 1 deletions
6
user.go
6
user.go
|
@ -748,7 +748,11 @@ func (user *User) handleReceipt(receipt *events.Receipt) {
|
|||
}
|
||||
}
|
||||
if receipt.Sender.User == user.JID.User {
|
||||
user.SetLastReadTS(portal.Key, markAsRead[0].Timestamp)
|
||||
if len(markAsRead) > 0 {
|
||||
user.SetLastReadTS(portal.Key, markAsRead[0].Timestamp)
|
||||
} else {
|
||||
user.SetLastReadTS(portal.Key, receipt.Timestamp)
|
||||
}
|
||||
}
|
||||
intent := user.bridge.GetPuppetByJID(receipt.Sender).IntentFor(portal)
|
||||
for _, msg := range markAsRead {
|
||||
|
|
Loading…
Reference in a new issue