Refactor sender key sends to allow distribution lists

This commit is contained in:
Scott Nonnenberg
2021-12-09 18:15:59 -08:00
committed by GitHub
parent 61a6f1b4cf
commit 161b0e5379
10 changed files with 210 additions and 110 deletions

View File

@@ -1316,10 +1316,10 @@ export async function modifyGroupV2({
timestamp,
profileKey,
},
conversation,
contentHint: ContentHint.RESENDABLE,
messageId: undefined,
sendOptions,
sendTarget: conversation.toSenderKeyTarget(),
sendType: 'groupChange',
}),
{ messageIds: [], sendType: 'groupChange' }
@@ -1686,15 +1686,15 @@ export async function createGroupV2({
messageIds: [],
send: async () =>
window.Signal.Util.sendToGroup({
contentHint: ContentHint.RESENDABLE,
groupSendOptions: {
groupV2: groupV2Info,
timestamp,
profileKey,
},
conversation,
contentHint: ContentHint.RESENDABLE,
messageId: undefined,
sendOptions,
sendTarget: conversation.toSenderKeyTarget(),
sendType: 'groupChange',
}),
sendType: 'groupChange',
@@ -2213,6 +2213,7 @@ export async function initiateMigrationToGroupV2(
send: async () =>
// Minimal message to notify group members about migration
window.Signal.Util.sendToGroup({
contentHint: ContentHint.RESENDABLE,
groupSendOptions: {
groupV2: conversation.getGroupV2Info({
includePendingMembers: true,
@@ -2220,10 +2221,9 @@ export async function initiateMigrationToGroupV2(
timestamp,
profileKey: ourProfileKey,
},
conversation,
contentHint: ContentHint.RESENDABLE,
messageId: undefined,
sendOptions,
sendTarget: conversation.toSenderKeyTarget(),
sendType: 'groupChange',
}),
sendType: 'groupChange',