fix: store device token in IMAP METADATA on each connection

APNS tokens never expire unless
the user uninstalls the application.
Because of this in most cases
the token remains valid forever
and chatmail server never removes the token
even if it is unencrypted
or the user has removed Delta Chat profile
from the device but not the whole application.

We want to modify chatmail servers
to remember the last time the token was stored
and remove them after some time.
Before we do this, we need to modify
the client to store the device token
each time so the server knows which tokens are used
and can update their timestamps.
This commit is contained in:
link2xt
2025-01-28 05:14:02 +00:00
committed by l
parent 6f5620dad5
commit 4198ed1efb
3 changed files with 52 additions and 23 deletions

View File

@@ -455,6 +455,13 @@ pub enum Config {
/// If it has not changed, we do not store
/// the device token again.
DeviceToken,
/// Device token encrypted with OpenPGP.
///
/// We store encrypted token next to `device_token`
/// to avoid encrypting it differently and
/// storing the same token multiple times on the server.
EncryptedDeviceToken,
}
impl Config {