Message Send Log to enable comprehensive resend
This commit is contained in:
parent
0fe68b57b1
commit
a42c41ed01
37 changed files with 3154 additions and 1266 deletions
|
@ -1,19 +1,19 @@
|
|||
// Copyright 2019-2021 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { handleMessageSend } from '../util/handleMessageSend';
|
||||
import { getSendOptions } from '../util/getSendOptions';
|
||||
|
||||
export async function sendStickerPackSync(
|
||||
packId: string,
|
||||
packKey: string,
|
||||
installed: boolean
|
||||
): Promise<void> {
|
||||
const { ConversationController, textsecure, log } = window;
|
||||
const ourNumber = textsecure.storage.user.getNumber();
|
||||
const { wrap, sendOptions } = await ConversationController.prepareForSend(
|
||||
ourNumber,
|
||||
{
|
||||
syncMessage: true,
|
||||
}
|
||||
);
|
||||
const ourConversation = ConversationController.getOurConversationOrThrow();
|
||||
const sendOptions = await getSendOptions(ourConversation.attributes, {
|
||||
syncMessage: true,
|
||||
});
|
||||
|
||||
if (!textsecure.messaging) {
|
||||
log.error(
|
||||
|
@ -23,7 +23,14 @@ export async function sendStickerPackSync(
|
|||
return;
|
||||
}
|
||||
|
||||
wrap(
|
||||
if (window.ConversationController.areWePrimaryDevice()) {
|
||||
window.log.warn(
|
||||
'shims/sendStickerPackSync: We are primary device; not sending sync'
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
handleMessageSend(
|
||||
textsecure.messaging.sendStickerPackSync(
|
||||
[
|
||||
{
|
||||
|
@ -33,7 +40,8 @@ export async function sendStickerPackSync(
|
|||
},
|
||||
],
|
||||
sendOptions
|
||||
)
|
||||
),
|
||||
{ messageIds: [], sendType: 'otherSync' }
|
||||
).catch(error => {
|
||||
log.error(
|
||||
'shim: Error calling sendStickerPackSync:',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue