feat: Sync self-avatar across devices (#4893)

Use sync messages for that as it is done for e.g. Config::Displayname. Maybe we need to remove
avatar synchronisation via usual messages then, but let's think of it a bit.
This commit is contained in:
iequidoo
2024-01-06 17:40:00 -03:00
committed by iequidoo
parent 5e3fcafb3a
commit 656d4ed506
4 changed files with 85 additions and 36 deletions

View File

@@ -276,10 +276,7 @@ impl Context {
AddQrToken(token) => self.add_qr_token(token).await,
DeleteQrToken(token) => self.delete_qr_token(token).await,
AlterChat { id, action } => self.sync_alter_chat(id, action).await,
SyncData::Config { key, val } => match key.is_synced() {
true => self.set_config_ex(Sync::Nosync, *key, Some(val)).await,
false => Ok(()),
},
SyncData::Config { key, val } => self.sync_config(key, val).await,
},
SyncDataOrUnknown::Unknown(data) => {
warn!(self, "Ignored unknown sync item: {data}.");