forked from MirrorHub/mautrix-whatsapp
Fix disappearing message notice spam when backfilling
This commit is contained in:
parent
9ac8ae984d
commit
4a5fbcb13a
1 changed files with 2 additions and 1 deletions
|
@ -140,7 +140,7 @@ func (user *User) backfillInChunks(req *database.Backfill, conv *database.Histor
|
||||||
// a notice indicating so.
|
// a notice indicating so.
|
||||||
if len(allMsgs) == 0 && conv.EphemeralExpiration != nil && *conv.EphemeralExpiration > 0 {
|
if len(allMsgs) == 0 && conv.EphemeralExpiration != nil && *conv.EphemeralExpiration > 0 {
|
||||||
lastMessage := portal.bridge.DB.Message.GetLastInChat(portal.Key)
|
lastMessage := portal.bridge.DB.Message.GetLastInChat(portal.Key)
|
||||||
if lastMessage == nil || !conv.LastMessageTimestamp.Equal(lastMessage.Timestamp) {
|
if lastMessage == nil || conv.LastMessageTimestamp.After(lastMessage.Timestamp) {
|
||||||
sendDisappearedNotice = true
|
sendDisappearedNotice = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -177,6 +177,7 @@ func (user *User) backfillInChunks(req *database.Backfill, conv *database.Histor
|
||||||
msg.JID = types.MessageID(resp.EventID)
|
msg.JID = types.MessageID(resp.EventID)
|
||||||
msg.Timestamp = conv.LastMessageTimestamp
|
msg.Timestamp = conv.LastMessageTimestamp
|
||||||
msg.Sent = true
|
msg.Sent = true
|
||||||
|
msg.Type = database.MsgFake
|
||||||
msg.Insert()
|
msg.Insert()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue