mirror of
https://github.com/chatmail/core.git
synced 2026-05-04 05:46:29 +03:00
Do not hide hidden messages in ChatId.delete_device_expired_messages()
This prevents infinite event loop, when chatlist is reloaded in response to event, and event is emitted by hiding messages before chatlist reload.
This commit is contained in:
@@ -389,11 +389,15 @@ impl ChatId {
|
||||
let threshold_timestamp = time() - delete_device_after;
|
||||
|
||||
// Hide expired messages
|
||||
//
|
||||
// Only update the rows that have to be updated, to avoid emitting
|
||||
// unnecessary "chat modified" events.
|
||||
let rows_modified = context.sql.execute(
|
||||
"UPDATE msgs \
|
||||
SET txt = 'DELETED', hidden = 1 \
|
||||
WHERE timestamp < ? \
|
||||
AND chat_id == ?",
|
||||
AND chat_id == ? \
|
||||
AND NOT hidden",
|
||||
params![threshold_timestamp, self],
|
||||
)?;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user