feat: Sync chat state immediately (#4817)

Sync messages are only sent on explicit user actions and only one per action, so it's safe to send
them right away not worrying about the rate limit on the server.
This commit is contained in:
iequidoo
2023-11-02 23:33:26 -03:00
committed by iequidoo
parent 16b40f3a19
commit f4753862f1
3 changed files with 8 additions and 4 deletions

View File

@@ -252,7 +252,7 @@ impl ChatId {
let chat_id = match ChatIdBlocked::lookup_by_contact(context, contact_id).await? {
Some(chat) => {
if create_blocked == Blocked::Not && chat.blocked != Blocked::Not {
chat.id.unblock_ex(context, Nosync).await?;
chat.id.set_blocked(context, Blocked::Not).await?;
}
chat.id
}
@@ -1903,6 +1903,7 @@ impl Chat {
context
.add_sync_item(SyncData::AlterChat { id, action })
.await?;
context.send_sync_msg().await?;
}
Ok(())
}