Import/export sticker packs

This commit is contained in:
Fedor Indutny 2024-06-12 13:47:56 -07:00 committed by GitHub
parent 111bb70188
commit 511a7f1646
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 62 additions and 15 deletions

View file

@ -212,6 +212,7 @@ export class BackupExportStream extends Readable {
distributionLists: 0,
messages: 0,
skippedMessages: 0,
stickerPacks: 0,
};
for (const { attributes } of window.ConversationController.getAll()) {
@ -284,6 +285,21 @@ export class BackupExportStream extends Readable {
stats.distributionLists += 1;
}
const stickerPacks = await Data.getInstalledStickerPacks();
for (const { id, key } of stickerPacks) {
this.pushFrame({
stickerPack: {
packId: Bytes.fromHex(id),
packKey: Bytes.fromBase64(key),
},
});
// eslint-disable-next-line no-await-in-loop
await this.flush();
stats.stickerPacks += 1;
}
const pinnedConversationIds =
window.storage.get('pinnedConversationIds') || [];