Update backup protos

This commit is contained in:
Fedor Indutny 2024-07-25 07:58:51 -07:00 committed by GitHub
parent 59d9807301
commit d627bf543e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 61 additions and 44 deletions

View file

@ -360,6 +360,7 @@ export class BackupExportStream extends Readable {
wallpaperPreset: attributes.wallpaperPreset,
color: attributes.conversationColor,
customColorId: attributes.customColorId,
dimWallpaperInDarkMode: attributes.dimWallpaperInDarkMode,
}),
},
});
@ -554,7 +555,7 @@ export class BackupExportStream extends Readable {
storage.get('phoneNumberDiscoverability')
) === PhoneNumberDiscoverability.NotDiscoverable,
preferContactAvatars: storage.get('preferContactAvatars'),
universalExpireTimer: storage.get('universalExpireTimer'),
universalExpireTimerSeconds: storage.get('universalExpireTimer'),
preferredReactionEmoji,
displayBadgesOnProfile: storage.get('displayBadgesOnProfile'),
keepMutedChatsArchived: storage.get('keepMutedChatsArchived'),
@ -1174,7 +1175,10 @@ export class BackupExportStream extends Readable {
if (isExpirationTimerUpdate(message)) {
const expiresInSeconds = message.expirationTimerUpdate?.expireTimer;
const expiresInMs = (expiresInSeconds ?? 0) * 1000;
const expiresInMs =
expiresInSeconds == null
? 0
: DurationInSeconds.toMillis(expiresInSeconds);
const conversation = window.ConversationController.get(
message.conversationId
@ -1184,7 +1188,7 @@ export class BackupExportStream extends Readable {
const groupChatUpdate = new Backups.GroupChangeChatUpdate();
const timerUpdate = new Backups.GroupExpirationTimerUpdate();
timerUpdate.expiresInMs = expiresInMs;
timerUpdate.expiresInMs = Long.fromNumber(expiresInMs);
const sourceServiceId = message.expirationTimerUpdate?.sourceServiceId;
if (sourceServiceId && Aci.parseFromServiceIdString(sourceServiceId)) {
@ -1212,7 +1216,7 @@ export class BackupExportStream extends Readable {
}
const expirationTimerChange = new Backups.ExpirationTimerChatUpdate();
expirationTimerChange.expiresInMs = expiresInMs;
expirationTimerChange.expiresInMs = Long.fromNumber(expiresInMs);
updateMessage.expirationTimerChange = expirationTimerChange;
@ -2309,6 +2313,10 @@ export class BackupExportStream extends Readable {
wallpaperPreset: window.storage.get('defaultWallpaperPreset'),
color: defaultColor?.color,
customColorId: defaultColor?.customColorData?.id,
dimWallpaperInDarkMode: window.storage.get(
'defaultDimWallpaperInDarkMode',
false
),
});
}
@ -2317,8 +2325,11 @@ export class BackupExportStream extends Readable {
wallpaperPreset,
color,
customColorId,
dimWallpaperInDarkMode,
}: LocalChatStyle): Backups.IChatStyle {
const result: Backups.IChatStyle = {};
const result: Backups.IChatStyle = {
dimWallpaperInDarkMode,
};
if (Bytes.isNotEmpty(wallpaperPhotoPointer)) {
result.wallpaperPhoto = Backups.FilePointer.decode(wallpaperPhotoPointer);