Include badgeIds when writing profile data

Co-authored-by: Josh Perez <60019601+josh-signal@users.noreply.github.com>
This commit is contained in:
automated-signal 2021-11-29 07:22:45 -08:00 committed by GitHub
parent 2d6a398120
commit b4b899c695
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 2 deletions

View File

@ -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),