mirror of
https://github.com/chatmail/core.git
synced 2026-04-27 18:36:30 +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;
|
||||
|
||||
// Hide expired messages
|
||||
context.sql.execute(
|
||||
let rows_modified = context.sql.execute(
|
||||
"UPDATE msgs \
|
||||
SET txt = 'DELETED', hidden = 1 \
|
||||
WHERE timestamp < ? \
|
||||
AND chat_id == ?",
|
||||
params![threshold_timestamp, self],
|
||||
)?;
|
||||
|
||||
if rows_modified > 0 {
|
||||
context.call_cb(Event::ChatModified(self));
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user