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 class-methods-use-this */
|
||||||
/* eslint-disable camelcase */
|
/* eslint-disable camelcase */
|
||||||
|
import { ProfileKeyCredentialRequestContext } from 'zkgroup';
|
||||||
import {
|
import {
|
||||||
MessageModelCollectionType,
|
MessageModelCollectionType,
|
||||||
WhatIsThis,
|
WhatIsThis,
|
||||||
|
@ -4363,8 +4364,10 @@ export class ConversationModel extends window.Backbone.Model<
|
||||||
const profileKeyVersionHex = c.get('profileKeyVersion')!;
|
const profileKeyVersionHex = c.get('profileKeyVersion')!;
|
||||||
const existingProfileKeyCredential = c.get('profileKeyCredential');
|
const existingProfileKeyCredential = c.get('profileKeyCredential');
|
||||||
|
|
||||||
let profileKeyCredentialRequestHex;
|
let profileKeyCredentialRequestHex: undefined | string;
|
||||||
let profileCredentialRequestContext;
|
let profileCredentialRequestContext:
|
||||||
|
| undefined
|
||||||
|
| ProfileKeyCredentialRequestContext;
|
||||||
|
|
||||||
if (
|
if (
|
||||||
profileKey &&
|
profileKey &&
|
||||||
|
@ -4512,15 +4515,17 @@ export class ConversationModel extends window.Backbone.Model<
|
||||||
c.unset('capabilities');
|
c.unset('capabilities');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (profileCredentialRequestContext && profile.credential) {
|
if (profileCredentialRequestContext) {
|
||||||
const profileKeyCredential = handleProfileKeyCredential(
|
if (profile.credential) {
|
||||||
clientZkProfileCipher,
|
const profileKeyCredential = handleProfileKeyCredential(
|
||||||
profileCredentialRequestContext,
|
clientZkProfileCipher,
|
||||||
profile.credential
|
profileCredentialRequestContext,
|
||||||
);
|
profile.credential
|
||||||
c.set({ profileKeyCredential });
|
);
|
||||||
} else {
|
c.set({ profileKeyCredential });
|
||||||
c.unset('profileKeyCredential');
|
} else {
|
||||||
|
c.unset('profileKeyCredential');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
switch (error?.code) {
|
switch (error?.code) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue