Fix sticker creator after CDN and typescript changes
This commit is contained in:
parent
3966d55d3b
commit
896dfcb43f
2 changed files with 7 additions and 2 deletions
|
@ -28,12 +28,13 @@ window.log.info('sticker-creator starting up...');
|
||||||
const Signal = require('../js/modules/signal');
|
const Signal = require('../js/modules/signal');
|
||||||
|
|
||||||
window.Signal = Signal.setup({});
|
window.Signal = Signal.setup({});
|
||||||
|
window.textsecure = require('../ts/textsecure').default;
|
||||||
|
|
||||||
const { initialize: initializeWebAPI } = require('../ts/textsecure/WebAPI');
|
const { initialize: initializeWebAPI } = require('../ts/textsecure/WebAPI');
|
||||||
|
|
||||||
const WebAPI = initializeWebAPI({
|
const WebAPI = initializeWebAPI({
|
||||||
url: config.serverUrl,
|
url: config.serverUrl,
|
||||||
cdn: {
|
cdnUrlObject: {
|
||||||
'0': config.cdnUrl0,
|
'0': config.cdnUrl0,
|
||||||
'2': config.cdnUrl2,
|
'2': config.cdnUrl2,
|
||||||
},
|
},
|
||||||
|
@ -146,7 +147,9 @@ window.encryptAndUpload = async (
|
||||||
|
|
||||||
async function encrypt(data, key, iv) {
|
async function encrypt(data, key, iv) {
|
||||||
const { ciphertext } = await window.textsecure.crypto.encryptAttachment(
|
const { ciphertext } = await window.textsecure.crypto.encryptAttachment(
|
||||||
window.Signal.Crypto.typedArrayToArrayBuffer(data),
|
data instanceof ArrayBuffer
|
||||||
|
? data
|
||||||
|
: window.Signal.Crypto.typedArrayToArrayBuffer(data),
|
||||||
key,
|
key,
|
||||||
iv
|
iv
|
||||||
);
|
);
|
||||||
|
|
2
ts/textsecure.d.ts
vendored
2
ts/textsecure.d.ts
vendored
|
@ -4,6 +4,7 @@ import {
|
||||||
SignedPreKeyType,
|
SignedPreKeyType,
|
||||||
StorageType,
|
StorageType,
|
||||||
} from './libsignal.d';
|
} from './libsignal.d';
|
||||||
|
import Crypto from './textsecure/Crypto';
|
||||||
import MessageReceiver from './textsecure/MessageReceiver';
|
import MessageReceiver from './textsecure/MessageReceiver';
|
||||||
import EventTarget from './textsecure/EventTarget';
|
import EventTarget from './textsecure/EventTarget';
|
||||||
import { ByteBufferClass } from './window.d';
|
import { ByteBufferClass } from './window.d';
|
||||||
|
@ -28,6 +29,7 @@ export type TextSecureType = {
|
||||||
id?: string,
|
id?: string,
|
||||||
options?: { timeout?: number }
|
options?: { timeout?: number }
|
||||||
) => () => Promise<any>;
|
) => () => Promise<any>;
|
||||||
|
crypto: typeof Crypto;
|
||||||
storage: {
|
storage: {
|
||||||
user: {
|
user: {
|
||||||
getNumber: () => string;
|
getNumber: () => string;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue