Address review comments

pull/1280/head
Maxim Shishmarev 5 years ago
parent cc43555cd2
commit db05592400

@ -7,6 +7,7 @@ export type IdentityKey = {
firstUse: boolean;
verified: number;
nonblockingApproval: boolean;
secretKey?: string; // found in medium groups
};
export type PreKey = {

@ -160,7 +160,6 @@ async function handleNewGroup(
envelope: EnvelopePlus,
groupUpdate: SignalService.MediumGroupUpdate
) {
window.log.error('mediumGroups.ts:hanldeNewGroup');
const { log } = window;
const {

@ -296,8 +296,20 @@ async function getOrCreateSenderKeysForUpdate(
}
async function getGroupSecretKey(groupId: string): Promise<Uint8Array> {
const groupIdentity = await window.Signal.Data.getIdentityKeyById(groupId);
return new Uint8Array(fromHex(groupIdentity.secretKey));
const groupIdentity = await Data.getIdentityKeyById(groupId);
if (!groupIdentity) {
throw new Error(`Could not load secret key for group ${groupId}`);
}
const secretKey = groupIdentity.secretKey;
if (!secretKey) {
throw new Error(
`Secret key not found in identity key record for group ${groupId}`
);
}
return new Uint8Array(fromHex(secretKey));
}
async function syncMediumGroup(group: ConversationModel) {
@ -336,7 +348,7 @@ async function syncMediumGroup(group: ConversationModel) {
};
// Note: we send this to our primary device which will in effect will send to
// our secondary devices, actually ignoring the primary
// our other devices, actually ignoring the current device
await sendGroupUpdateForMedium(
{ joiningMembers: [ourPrimary.key] },
groupUpdate

Loading…
Cancel
Save