refactor: Move chat-related code from sync to chat module

- Reduce cross-module dependencies.
- Stop bloating the `sync` module while implementing synchronisation of more entities.
- Now there's the only `ChatId` :)
This commit is contained in:
iequidoo
2023-11-10 23:32:29 -03:00
committed by iequidoo
parent dc944d8ca7
commit 34a434f07c
3 changed files with 230 additions and 228 deletions

View File

@@ -1480,12 +1480,12 @@ WHERE type=? AND id IN (
if sync.into() {
let action = match new_blocking {
true => sync::ChatAction::Block,
false => sync::ChatAction::Unblock,
true => chat::SyncAction::Block,
false => chat::SyncAction::Unblock,
};
context
.add_sync_item(SyncData::AlterChat {
id: sync::ChatId::ContactAddr(contact.addr.clone()),
id: chat::SyncId::ContactAddr(contact.addr.clone()),
action,
})
.await?;