mirror of
https://github.com/tulir/mautrix-whatsapp
synced 2024-12-15 01:43:49 +01:00
Don't send read receipts for fake JIDs
This commit is contained in:
parent
c2520c14db
commit
0d977bc610
1 changed files with 3 additions and 1 deletions
|
@ -2278,8 +2278,10 @@ func (portal *Portal) HandleMatrixReadReceipt(sender *User, eventID id.EventID,
|
||||||
}
|
}
|
||||||
groupedMessages := make(map[types.JID][]types.MessageID)
|
groupedMessages := make(map[types.JID][]types.MessageID)
|
||||||
for _, msg := range messages {
|
for _, msg := range messages {
|
||||||
|
if !msg.IsFakeJID() {
|
||||||
groupedMessages[msg.Sender] = append(groupedMessages[msg.Sender], msg.JID)
|
groupedMessages[msg.Sender] = append(groupedMessages[msg.Sender], msg.JID)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
portal.log.Debugfln("Sending read receipts by %s: %v", sender.JID, groupedMessages)
|
portal.log.Debugfln("Sending read receipts by %s: %v", sender.JID, groupedMessages)
|
||||||
for messageSender, ids := range groupedMessages {
|
for messageSender, ids := range groupedMessages {
|
||||||
err := sender.Client.MarkRead(ids, receiptTimestamp, portal.Key.JID, messageSender)
|
err := sender.Client.MarkRead(ids, receiptTimestamp, portal.Key.JID, messageSender)
|
||||||
|
|
Loading…
Reference in a new issue