From c9678c48770a02a3c1a8617093471b1a8b28e173 Mon Sep 17 00:00:00 2001 From: Josh Perez <60019601+josh-signal@users.noreply.github.com> Date: Wed, 24 Nov 2021 13:48:25 -0500 Subject: [PATCH] Include badgeIds when writing profile data --- ts/util/encryptProfileData.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/ts/util/encryptProfileData.ts b/ts/util/encryptProfileData.ts index 5d07ed31f2..35932baa60 100644 --- a/ts/util/encryptProfileData.ts +++ b/ts/util/encryptProfileData.ts @@ -16,8 +16,15 @@ export async function encryptProfileData( conversation: ConversationType, avatarBuffer?: Uint8Array ): Promise<[ProfileRequestDataType, Uint8Array | undefined]> { - const { aboutEmoji, aboutText, familyName, firstName, profileKey, uuid } = - conversation; + const { + aboutEmoji, + aboutText, + badges, + familyName, + firstName, + profileKey, + uuid, + } = conversation; assert(profileKey, 'profileKey'); assert(uuid, 'uuid'); @@ -57,6 +64,7 @@ export async function encryptProfileData( name: Bytes.toBase64(bytesName), about: bytesAbout ? Bytes.toBase64(bytesAbout) : null, aboutEmoji: bytesAboutEmoji ? Bytes.toBase64(bytesAboutEmoji) : null, + badgeIds: (badges || []).map(({ id }) => id), paymentAddress: window.storage.get('paymentAddress') || null, avatar: Boolean(avatarBuffer), commitment: deriveProfileKeyCommitment(profileKey, uuid),