Fix recursion loop in sendStory
This commit is contained in:
parent
8d7cbeef64
commit
1e825fd1e8
1 changed files with 8 additions and 4 deletions
|
@ -278,6 +278,8 @@ export async function sendStory(
|
||||||
isGroupV2(messageConversation.attributes) ||
|
isGroupV2(messageConversation.attributes) ||
|
||||||
Boolean(distributionList?.allowsReplies);
|
Boolean(distributionList?.allowsReplies);
|
||||||
|
|
||||||
|
let inMemorySenderKeyInfo = distributionList?.senderKeyInfo;
|
||||||
|
|
||||||
const sendTarget = distributionList
|
const sendTarget = distributionList
|
||||||
? {
|
? {
|
||||||
getGroupId: () => undefined,
|
getGroupId: () => undefined,
|
||||||
|
@ -289,12 +291,14 @@ export async function sendStory(
|
||||||
idForLogging: () => `dl(${receiverId})`,
|
idForLogging: () => `dl(${receiverId})`,
|
||||||
isGroupV2: () => true,
|
isGroupV2: () => true,
|
||||||
isValid: () => true,
|
isValid: () => true,
|
||||||
getSenderKeyInfo: () => distributionList.senderKeyInfo,
|
getSenderKeyInfo: () => inMemorySenderKeyInfo,
|
||||||
saveSenderKeyInfo: async (senderKeyInfo: SenderKeyInfoType) =>
|
saveSenderKeyInfo: async (senderKeyInfo: SenderKeyInfoType) => {
|
||||||
dataInterface.modifyStoryDistribution({
|
inMemorySenderKeyInfo = senderKeyInfo;
|
||||||
|
await dataInterface.modifyStoryDistribution({
|
||||||
...distributionList,
|
...distributionList,
|
||||||
senderKeyInfo,
|
senderKeyInfo,
|
||||||
}),
|
});
|
||||||
|
},
|
||||||
}
|
}
|
||||||
: conversation.toSenderKeyTarget();
|
: conversation.toSenderKeyTarget();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue