mirror of
https://github.com/matrix-org/matrix-rust-sdk.git
synced 2026-05-09 08:27:32 -04:00
feat(store): also delete thread subscriptions when deleting a room in db
This commit is contained in:
@@ -754,6 +754,7 @@ impl StateStore for MemoryStore {
|
||||
inner.room_event_receipts.remove(room_id);
|
||||
inner.send_queue_events.remove(room_id);
|
||||
inner.dependent_send_queue_events.remove(room_id);
|
||||
inner.thread_subscriptions.remove(room_id);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -1766,6 +1766,13 @@ impl StateStore for SqliteStateStore {
|
||||
this.encode_key(keys::DEPENDENTS_SEND_QUEUE, &room_id);
|
||||
txn.remove_room_dependent_send_queue(&dependent_send_queue_room_id)?;
|
||||
|
||||
let thread_subscriptions_room_id =
|
||||
this.encode_key(keys::THREAD_SUBSCRIPTIONS, &room_id);
|
||||
txn.execute(
|
||||
"DELETE FROM thread_subscriptions WHERE room_id = ?",
|
||||
(thread_subscriptions_room_id,),
|
||||
)?;
|
||||
|
||||
Ok(())
|
||||
})
|
||||
.await?;
|
||||
|
||||
Reference in New Issue
Block a user