Stop using deprecated PniCredential
This commit is contained in:
parent
b7526d4e26
commit
59da9c7ae5
12 changed files with 38 additions and 241 deletions
34
ts/groups.ts
34
ts/groups.ts
|
@ -35,7 +35,6 @@ import type {
|
|||
} from './model-types.d';
|
||||
import {
|
||||
createProfileKeyCredentialPresentation,
|
||||
createPNICredentialPresentation,
|
||||
decodeProfileKeyCredentialPresentation,
|
||||
decryptGroupBlob,
|
||||
decryptProfileKey,
|
||||
|
@ -1357,15 +1356,15 @@ export function buildPromotePendingAdminApprovalMemberChange({
|
|||
export type BuildPromoteMemberChangeOptionsType = Readonly<{
|
||||
group: ConversationAttributesType;
|
||||
serverPublicParamsBase64: string;
|
||||
profileKeyCredentialBase64?: string;
|
||||
pniCredentialBase64?: string;
|
||||
profileKeyCredentialBase64: string;
|
||||
isPendingPniAciProfileKey: boolean;
|
||||
}>;
|
||||
|
||||
export function buildPromoteMemberChange({
|
||||
group,
|
||||
profileKeyCredentialBase64,
|
||||
pniCredentialBase64,
|
||||
serverPublicParamsBase64,
|
||||
isPendingPniAciProfileKey = false,
|
||||
}: BuildPromoteMemberChangeOptionsType): Proto.GroupChange.Actions {
|
||||
const actions = new Proto.GroupChange.Actions();
|
||||
|
||||
|
@ -1381,31 +1380,20 @@ export function buildPromoteMemberChange({
|
|||
serverPublicParamsBase64
|
||||
);
|
||||
|
||||
let presentation: Uint8Array;
|
||||
if (profileKeyCredentialBase64 !== undefined) {
|
||||
presentation = createProfileKeyCredentialPresentation(
|
||||
clientZkProfileCipher,
|
||||
profileKeyCredentialBase64,
|
||||
group.secretParams
|
||||
);
|
||||
const presentation = createProfileKeyCredentialPresentation(
|
||||
clientZkProfileCipher,
|
||||
profileKeyCredentialBase64,
|
||||
group.secretParams
|
||||
);
|
||||
|
||||
actions.promotePendingMembers = [
|
||||
if (isPendingPniAciProfileKey) {
|
||||
actions.promoteMembersPendingPniAciProfileKey = [
|
||||
{
|
||||
presentation,
|
||||
},
|
||||
];
|
||||
} else {
|
||||
strictAssert(
|
||||
pniCredentialBase64,
|
||||
'Either pniCredential or profileKeyCredential must be present'
|
||||
);
|
||||
presentation = createPNICredentialPresentation(
|
||||
clientZkProfileCipher,
|
||||
pniCredentialBase64,
|
||||
group.secretParams
|
||||
);
|
||||
|
||||
actions.promoteMembersPendingPniAciProfileKey = [
|
||||
actions.promotePendingMembers = [
|
||||
{
|
||||
presentation,
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue