Fix bug where we'd remove profileKeyCredentials incorrectly
This commit is contained in:
parent
afe135df0c
commit
de5943a5fb
1 changed files with 16 additions and 11 deletions
|
@ -3,6 +3,7 @@
|
|||
|
||||
/* eslint-disable class-methods-use-this */
|
||||
/* eslint-disable camelcase */
|
||||
import { ProfileKeyCredentialRequestContext } from 'zkgroup';
|
||||
import {
|
||||
MessageModelCollectionType,
|
||||
WhatIsThis,
|
||||
|
@ -4363,8 +4364,10 @@ export class ConversationModel extends window.Backbone.Model<
|
|||
const profileKeyVersionHex = c.get('profileKeyVersion')!;
|
||||
const existingProfileKeyCredential = c.get('profileKeyCredential');
|
||||
|
||||
let profileKeyCredentialRequestHex;
|
||||
let profileCredentialRequestContext;
|
||||
let profileKeyCredentialRequestHex: undefined | string;
|
||||
let profileCredentialRequestContext:
|
||||
| undefined
|
||||
| ProfileKeyCredentialRequestContext;
|
||||
|
||||
if (
|
||||
profileKey &&
|
||||
|
@ -4512,15 +4515,17 @@ export class ConversationModel extends window.Backbone.Model<
|
|||
c.unset('capabilities');
|
||||
}
|
||||
|
||||
if (profileCredentialRequestContext && profile.credential) {
|
||||
const profileKeyCredential = handleProfileKeyCredential(
|
||||
clientZkProfileCipher,
|
||||
profileCredentialRequestContext,
|
||||
profile.credential
|
||||
);
|
||||
c.set({ profileKeyCredential });
|
||||
} else {
|
||||
c.unset('profileKeyCredential');
|
||||
if (profileCredentialRequestContext) {
|
||||
if (profile.credential) {
|
||||
const profileKeyCredential = handleProfileKeyCredential(
|
||||
clientZkProfileCipher,
|
||||
profileCredentialRequestContext,
|
||||
profile.credential
|
||||
);
|
||||
c.set({ profileKeyCredential });
|
||||
} else {
|
||||
c.unset('profileKeyCredential');
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
switch (error?.code) {
|
||||
|
|
Loading…
Add table
Reference in a new issue