mirror of
https://github.com/tulir/gomuks.git
synced 2025-04-19 02:03:40 -05:00
hicli/sync: fix updating preview event rowid on redaction
This commit is contained in:
parent
7f80301276
commit
0ed5dfcc12
2 changed files with 3 additions and 3 deletions
|
@ -80,7 +80,7 @@ const (
|
|||
AND (type IN ('m.room.message', 'm.sticker')
|
||||
OR (type = 'm.room.encrypted'
|
||||
AND decrypted_type IN ('m.room.message', 'm.sticker')))
|
||||
AND relation_type <> 'm.replace'
|
||||
AND (relation_type IS NULL OR relation_type <> 'm.replace')
|
||||
AND redacted_by IS NULL
|
||||
ORDER BY timestamp DESC
|
||||
LIMIT 1
|
||||
|
@ -215,7 +215,7 @@ func (r *Room) CheckChangesAndCopyInto(other *Room) (hasChanges bool) {
|
|||
hasChanges = true
|
||||
other.HasMemberList = true
|
||||
}
|
||||
if r.PreviewEventRowID > other.PreviewEventRowID {
|
||||
if r.PreviewEventRowID != 0 {
|
||||
other.PreviewEventRowID = r.PreviewEventRowID
|
||||
hasChanges = true
|
||||
}
|
||||
|
|
|
@ -785,7 +785,7 @@ func (h *HiClient) processStateAndTimeline(
|
|||
return fmt.Errorf("failed to get relation target of redaction target: %w", err)
|
||||
}
|
||||
}
|
||||
if updatedRoom.PreviewEventRowID == dbEvt.RowID {
|
||||
if updatedRoom.PreviewEventRowID == dbEvt.RowID || (updatedRoom.PreviewEventRowID == 0 && room.PreviewEventRowID == dbEvt.RowID) {
|
||||
updatedRoom.PreviewEventRowID = 0
|
||||
recalculatePreviewEvent = true
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue