mirror of
https://github.com/chatmail/core.git
synced 2026-05-08 17:36:29 +03:00
Emit "chat modified" event when messages expire
This commit is contained in:
@@ -389,13 +389,17 @@ impl ChatId {
|
|||||||
let threshold_timestamp = time() - delete_device_after;
|
let threshold_timestamp = time() - delete_device_after;
|
||||||
|
|
||||||
// Hide expired messages
|
// Hide expired messages
|
||||||
context.sql.execute(
|
let rows_modified = context.sql.execute(
|
||||||
"UPDATE msgs \
|
"UPDATE msgs \
|
||||||
SET txt = 'DELETED', hidden = 1 \
|
SET txt = 'DELETED', hidden = 1 \
|
||||||
WHERE timestamp < ? \
|
WHERE timestamp < ? \
|
||||||
AND chat_id == ?",
|
AND chat_id == ?",
|
||||||
params![threshold_timestamp, self],
|
params![threshold_timestamp, self],
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
|
if rows_modified > 0 {
|
||||||
|
context.call_cb(Event::ChatModified(self));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user