2019-05-16 22:32:11 +00:00
|
|
|
export function sendStickerPackSync(
|
|
|
|
packId: string,
|
|
|
|
packKey: string,
|
|
|
|
installed: boolean
|
|
|
|
) {
|
2020-03-31 20:03:38 +00:00
|
|
|
const { ConversationController, textsecure, log } = window;
|
2019-05-16 22:32:11 +00:00
|
|
|
const ourNumber = textsecure.storage.user.getNumber();
|
|
|
|
const { wrap, sendOptions } = ConversationController.prepareForSend(
|
|
|
|
ourNumber,
|
|
|
|
{ syncMessage: true }
|
|
|
|
);
|
|
|
|
|
|
|
|
if (!textsecure.messaging) {
|
|
|
|
log.error(
|
|
|
|
'shim: Cannot call sendStickerPackSync, textsecure.messaging is falsey'
|
|
|
|
);
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
wrap(
|
|
|
|
textsecure.messaging.sendStickerPackSync(
|
|
|
|
[
|
|
|
|
{
|
|
|
|
packId,
|
|
|
|
packKey,
|
|
|
|
installed,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
sendOptions
|
|
|
|
)
|
|
|
|
).catch(error => {
|
|
|
|
log.error(
|
|
|
|
'shim: Error calling sendStickerPackSync:',
|
|
|
|
error && error.stack ? error.stack : error
|
|
|
|
);
|
|
|
|
});
|
|
|
|
}
|