diff --git a/src/controllers/auth.ts b/src/controllers/auth.ts
index c1fdbd894..6bd231a8a 100644
--- a/src/controllers/auth.ts
+++ b/src/controllers/auth.ts
@@ -37,10 +37,7 @@ export const getInterfaceStatus = async (
return 'UNPAIRED';
}
- const streamStatus =
- window['Store'] &&
- window['Store'].Stream &&
- window['Store'].Stream.displayInfo;
+ const streamStatus = WPP?.whatsapp?.Stream?.displayInfo;
if (['PAIRING', 'RESUMING', 'SYNCING'].includes(streamStatus)) {
return 'PAIRING';
}
diff --git a/src/lib/wapi/business/send-message-with-buttons.js b/src/lib/wapi/business/send-message-with-buttons.js
deleted file mode 100644
index ca60b3839..000000000
--- a/src/lib/wapi/business/send-message-with-buttons.js
+++ /dev/null
@@ -1,355 +0,0 @@
-/*
- * This file is part of WPPConnect.
- *
- * WPPConnect is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * WPPConnect is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with WPPConnect. If not, see .
- */
-
-window.WAPI.sendButtons = async function (chatId) {
- var chat = WPP.whatsapp.ChatStore.get(chatId);
- var tempMsg = Object.create(chat.msgs.filter((msg) => msg.__x_isSentByMe)[0]);
- // var tempMsg = Object.create(WPP.whatsapp.MsgStore.getModelsArray().filter(msg => msg.to._serialized===chatId&&msg.__x_isSentByMe&& msg.type=='chat' && !msg.quotedStanzaID)[0])
- var t2 = Object.create(
- WPP.whatsapp.MsgStore.filter(
- (x) => (x.type == 'template') & !x.id.fromMe
- )[0]
- );
- var newId = WPP.chat.generateMessageID(chatId);
- delete tempMsg.hasTemplateButtons;
- var extend = {
- ack: 0,
- id: newId,
- local: !0,
- self: 'out',
- t: parseInt(new Date().getTime() / 1000),
- to: chat.id,
- isNewMsg: false,
- // isNewMsg: !0,
- type: 'template',
- subtype: 'text',
- body: 'body text',
- isForwarded: false,
- broadcast: false,
- isQuotedMsgAvailable: false,
- shouldEnableHsm: true,
- __x_hasTemplateButtons: true,
- invis: true,
- };
-
- Object.assign(tempMsg, extend);
-
- var btns = new Store.Builders.HydratedFourRowTemplate({
- hydratedButtons: [
- new Store.Builders.HydratedTemplateButton({
- quickReplyButton: new Store.Builders.HydratedQuickReplyButton({
- displayText: 'test',
- id: '{"eventName":"inform"}',
- quickReplyButton: true,
- }),
- index: 0,
- }),
- new Store.Builders.HydratedTemplateButton({
- callButton: new Store.Builders.HydratedCallButton({
- displayText: 'test call',
- phoneNumber: '4477777777777',
- }),
- index: 1,
- }),
- new Store.Builders.HydratedTemplateButton({
- urlButton: new Store.Builders.HydratedURLButton({
- displayText: 'test url',
- url: 'https://google.com',
- }),
- index: 2,
- }),
- ],
- hydratedContentText: 'hellllloooowww',
- hydratedFooterText: 'asdasd',
- hydratedTitleText: 'asdasd232',
- });
-
- Store.Parser.parseTemplateMessage(t2, btns);
- tempMsg.buttons = t2.buttons;
- console.log('t2', t2.body);
- tempMsg.mediaData = undefined;
- tempMsg.mediaObject = undefined;
- tempMsg._minEphemeralExpirationTimestamp();
- tempMsg.senderObj.isBusiness = true;
- tempMsg.senderObj.isEnterprise = true;
- tempMsg.senderObj = {
- ...tempMsg.senderObj,
- isBusiness: true,
- isEnterprise: true,
- notifyName: 'button test',
- mentionName: 'Button Test',
- displayName: 'Button Test',
- searchName: 'button test',
- header: 'b',
- formattedShortNameWithNonBreakingSpaces: 'Button test',
- formattedShortName: 'Button test',
- formattedName: 'Button test',
- formattedUser: 'Button test',
- };
- tempMsg.body = t2.body;
- tempMsg.to = tempMsg.from;
- tempMsg.caption = tempMsg.body;
- console.log('tempMsg', tempMsg);
- return chat.sendQueue
- .enqueue(
- chat.addQueue
- .enqueue(
- Store.MessageUtils.appendMessage(chat, tempMsg).then(() => {
- var e = WPP.whatsapp.MsgStore.add(tempMsg)[0];
- console.log('e ', e);
- if (e) {
- return e.waitForPrep().then(() => {
- return e;
- });
- }
- })
- )
- .then((t) => chat.msgs.add(t))
- .catch((e) => console.log(e))
- )
- .then((t) => {
- var e = t[0];
- const s = Store.Base2;
- if (!s.BinaryProtocol)
- window.Store.Base2.BinaryProtocol = new window.Store.bp(11);
- var idUser = new WPP.whatsapp.WidFactory.createWid(chatId);
- var k = Store.createMessageKey({
- ...e,
- to: idUser,
- id: e.__x_id,
- });
- console.log('key', k);
- var wm = new Store.WebMessageInfo({
- message: new Store.Builders.Message({
- // conversation:'okhellowhi',
- templateMessage: new Store.Builders.TemplateMessage({
- hydratedFourRowTemplate: btns,
- hydratedTemplate: btns,
- }),
- }),
- key: k,
- messageTimestamp: e.t,
- multicast: undefined,
- url: undefined,
- urlNumber: undefined,
- clearMedia: undefined,
- ephemeralDuration: undefined,
- });
- console.log('wm', wm);
- var action = s.actionNode('relay', [
- ['message', null, Store.WebMessageInfo.encode(wm).readBuffer()],
- ]);
- console.log('action', action);
- var a = e.id.id;
- return new Promise(function (resolve, reject) {
- console.log('yo');
- return s.binSend(
- 'send',
- action,
- reject,
- {
- tag: a,
- onSend: s.wrap((_) => {
- console.log('onsend', _);
- resolve(_);
- }),
- onDrop: s.wrap((_) => {
- console.log('ondrop', _);
- reject(_);
- }),
- retryOn5xx: !0,
- resendGuard: function (_) {
- var t = WPP.whatsapp.MsgStore.get(e.id);
- console.log('in resend', _);
- return 'protocol' === e.type || (t && t.id.equals(e.id));
- },
- },
- {
- debugString: ['action', 'message', e.type, e.subtype, a].join(),
- debugObj: {
- xml: action,
- pb: wm,
- },
- metricName: 'MESSAGE',
- ackRequest: !1,
- }
- );
- });
- });
-};
-
-window.WAPI.sendButtons2 = async function (chatId) {
- var chat = WPP.whatsapp.ChatStore.get(chatId);
- var tempMsg = Object.create(
- WPP.whatsapp.MsgStore.getModelsArray().filter(
- (msg) =>
- msg.to._serialized === chatId &&
- msg.__x_isSentByMe &&
- msg.type == 'chat' &&
- !msg.quotedStanzaID
- )[0]
- );
- var t2 = Object.create(
- WPP.whatsapp.MsgStore.getModelsArray().filter(
- (msg) =>
- msg.to._serialized === chatId &&
- msg.__x_isSentByMe &&
- msg.type == 'chat' &&
- !msg.quotedStanzaID
- )[0]
- );
- var newId = WPP.chat.generateMessageID(chatId);
- delete tempMsg.hasTemplateButtons;
- var extend = {
- ack: 0,
- id: newId,
- local: !0,
- self: 'out',
- t: parseInt(new Date().getTime() / 1000),
- to: WPP.whatsapp.WidFactory.createWid(chatId),
- isNewMsg: !0,
- type: 'template',
- subtype: 'text',
- broadcast: false,
- isQuotedMsgAvailable: false,
- shouldEnableHsm: true,
- __x_hasTemplateButtons: true,
- invis: false,
- };
-
- Object.assign(tempMsg, extend);
-
- var btns = new Store.Builders.HydratedFourRowTemplate({
- hydratedButtons: [
- new Store.Builders.HydratedTemplateButton({
- quickReplyButton: new Store.Builders.HydratedQuickReplyButton({
- displayText: 'test',
- id: '{"eventName":"inform"}',
- quickReplyButton: true,
- }),
- index: 0,
- }),
- new Store.Builders.HydratedTemplateButton({
- callButton: new Store.Builders.HydratedCallButton({
- displayText: 'test call',
- phoneNumber: '4477777777777',
- }),
- index: 1,
- }),
- new Store.Builders.HydratedTemplateButton({
- callButton: new Store.Builders.HydratedCallButton({
- displayText: 'test call',
- phoneNumber: '4477777777777',
- }),
- index: 2,
- }),
- new Store.Builders.HydratedTemplateButton({
- urlButton: new Store.Builders.HydratedURLButton({
- displayText: 'test url',
- url: 'https://google.com',
- }),
- index: 3,
- }),
- ],
- hydratedContentText: 'hellllloooowww',
- hydratedFooterText: 'asdasd',
- hydratedTitleText: 'asdasd232',
- });
-
- Store.Parser.parseTemplateMessage(t2, btns);
- tempMsg.buttons = t2.buttons;
- console.log('t2', t2.body);
- console.log('tempMsg', tempMsg);
-
- return chat.sendQueue
- .enqueue(
- chat.addQueue
- .enqueue(
- Store.MessageUtils.appendMessage(chat, tempMsg).then(() => {
- var e = WPP.whatsapp.MsgStore.add(tempMsg)[0];
- console.log('e ', e);
- if (e) {
- return e.waitForPrep().then(() => {
- return e;
- });
- }
- })
- )
- .then((t) => chat.msgs.add(t))
- .catch((e) => console.log(e))
- )
- .then((t) => {
- var e = t[0];
- console.log('e', e);
- const s = Store.Base2;
- if (!s.BinaryProtocol)
- window.Store.Base2.BinaryProtocol = new window.Store.bp(11);
- var idUser = new WPP.whatsapp.WidFactory.createWid(chatId);
- var k = Store.createMessageKey({
- ...e,
- to: idUser,
- id: e.__x_id,
- });
- console.log('key', k);
- var wm = new Store.WebMessageInfo({
- message: new Store.Builders.Message({
- //if you uncomment the next line then the message gets sent properly as a text
- // conversation:'okhellowhi',
- templateMessage: new Store.Builders.TemplateMessage({
- hydratedFourRowTemplate: btns,
- hydratedTemplate: btns,
- }),
- }),
- key: k,
- messageTimestamp: e.t,
- });
- console.log('wm', wm);
- var action = s.actionNode('relay', [
- ['message', null, Store.WebMessageInfo.encode(wm).readBuffer()],
- ]);
- console.log('action', action);
- var a = e.id.id;
- console.log('a', a);
- return new Promise(function (resolve, reject) {
- console.log('yo');
- return s.binSend(
- 'send',
- action,
- reject,
- {
- tag: a,
- onSend: s.wrap(resolve),
- onDrop: s.wrap(reject),
- retryOn5xx: !0,
- resendGuard: function (_) {
- var t = WPP.whatsapp.MsgStore.get(e.id);
- return 'protocol' === e.type || (t && t.id.equals(e.id));
- },
- },
- {
- debugString: ['action', 'message', 'chat', 'null', a].join(),
- debugObj: {
- xml: action,
- pb: wm,
- },
- metricName: 'MESSAGE',
- ackRequest: !1,
- }
- );
- });
- });
-};
diff --git a/src/lib/wapi/functions/index.js b/src/lib/wapi/functions/index.js
index bfe7676ba..cbc1c7321 100644
--- a/src/lib/wapi/functions/index.js
+++ b/src/lib/wapi/functions/index.js
@@ -61,7 +61,6 @@ export { sendChatstate } from './send-chat-state';
export { sendFile } from './send-file';
export { sendImage } from './send-image';
export { sendPtt } from './send-ptt';
-export { sendImageAsSticker } from './send-image-as-stricker';
export { sendImageWithProduct } from './send-image-with-product';
export { sendLocation } from './send-location';
export { sendMessage } from './send-message';
@@ -69,15 +68,12 @@ export { sendMessageOptions } from './sendMessageOptions';
export { sendMessageWithTags } from './send-message-with-tags';
export { sendMessageWithThumb } from './send-message-with-thumb';
export { sendMessage2 } from './send-message2';
-export { sendSticker } from './send-sticker';
export { sendVideoAsGif } from './send-video-as-gif';
export { setMyName } from './set-my-name';
export { forwardMessages } from './forward-messages';
export { getMessageById } from './get-message-by-id';
export { getMessages } from './get-messages';
export { setTheme, getTheme } from './theme';
-export { restartService } from './restart-service';
-export { killServiceWorker } from './kill-service-worker';
export { sendLinkPreview } from './send-link-preview';
export { sendExist, scope, getchatId } from './check-send-exist';
export { setProfilePic } from './set-profile-pic';
diff --git a/src/lib/wapi/functions/kill-service-worker.js b/src/lib/wapi/functions/kill-service-worker.js
deleted file mode 100644
index dafb2d5e2..000000000
--- a/src/lib/wapi/functions/kill-service-worker.js
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * This file is part of WPPConnect.
- *
- * WPPConnect is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * WPPConnect is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with WPPConnect. If not, see .
- */
-
-export async function killServiceWorker() {
- await Store.ServiceWorker.default.killServiceWorker();
- return true;
-}
diff --git a/src/lib/wapi/functions/phoneWatchdog.js b/src/lib/wapi/functions/phoneWatchdog.js
index d018ab9c5..ec2a06c51 100644
--- a/src/lib/wapi/functions/phoneWatchdog.js
+++ b/src/lib/wapi/functions/phoneWatchdog.js
@@ -21,7 +21,7 @@ let pong = true;
async function sendPing() {
// Check only if the interface is in CHAT and not disconnected
if (
- window.Store.Stream.mode !== 'MAIN' ||
+ WPP.whatsapp.Stream.mode !== 'MAIN' ||
WPP.whatsapp.Socket.state === 'TIMEOUT'
) {
return;
diff --git a/src/lib/wapi/functions/restart-service.js b/src/lib/wapi/functions/restart-service.js
deleted file mode 100644
index bef277535..000000000
--- a/src/lib/wapi/functions/restart-service.js
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * This file is part of WPPConnect.
- *
- * WPPConnect is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * WPPConnect is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with WPPConnect. If not, see .
- */
-
-export async function restartService() {
- await Store.ServiceWorker.default.restart();
- return true;
-}
diff --git a/src/lib/wapi/functions/send-image-as-stricker.js b/src/lib/wapi/functions/send-image-as-stricker.js
deleted file mode 100644
index 28a47fe4b..000000000
--- a/src/lib/wapi/functions/send-image-as-stricker.js
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * This file is part of WPPConnect.
- *
- * WPPConnect is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * WPPConnect is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with WPPConnect. If not, see .
- */
-
-import { base64ToFile } from '../helper/base64-to-file';
-import { sendSticker } from './send-sticker';
-
-/**
- * Sends image as sticker to given chat id
- * @param {string} imageBase64 Image as base64 A valid webp image is required.
- * @param {string} chatId chat id '000000000000@c.us'
- * @param {*} metadata about the image. Based on [sharp metadata](https://sharp.pixelplumbing.com/api-input#metadata)
- */
-export async function sendImageAsSticker(imageBase64, chatId, metadata, type) {
- const mediaBlob = base64ToFile(
- 'data:image/webp;base64,' + imageBase64,
- 'file.webp'
- );
- let encrypted = await window.WAPI.encryptAndUploadFile('sticker', mediaBlob);
-
- return await sendSticker(encrypted, chatId, metadata, type);
-}
diff --git a/src/lib/wapi/functions/send-link-preview.js b/src/lib/wapi/functions/send-link-preview.js
index 1732dcdbf..5c8e60098 100644
--- a/src/lib/wapi/functions/send-link-preview.js
+++ b/src/lib/wapi/functions/send-link-preview.js
@@ -46,7 +46,7 @@ export async function sendLinkPreview(chatId, url, text) {
// There are no support for link preview with MD
const linkPreview = WPP.conn.isMultiDevice()
? undefined
- : await Store.WapQuery.queryLinkPreview(url);
+ : await WPP.whatsapp.functions.queryLinkPreview(url);
var result =
(await chat.sendMessage(text.includes(url) ? text : `${url}\n${text}`, {
linkPreview,
diff --git a/src/lib/wapi/functions/send-sticker.js b/src/lib/wapi/functions/send-sticker.js
deleted file mode 100644
index 1235e2a61..000000000
--- a/src/lib/wapi/functions/send-sticker.js
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * This file is part of WPPConnect.
- *
- * WPPConnect is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * WPPConnect is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with WPPConnect. If not, see .
- */
-
-export async function sendSticker(sticker, chatId, metadata, type) {
- var chat = await WAPI.sendExist(chatId);
-
- if (!chat.erro) {
- var stick = new window.Store.Sticker.default.modelClass();
-
- stick.__x_clientUrl = sticker.clientUrl;
- stick.__x_filehash = sticker.filehash;
- stick.__x_id = sticker.filehash;
- stick.__x_uploadhash = sticker.uploadhash;
- stick.__x_mediaKey = sticker.mediaKey;
- stick.__x_initialized = false;
- stick.__x_mediaData.mediaStage = 'INIT';
- stick.mimetype = 'image/webp';
- stick.height = metadata && metadata.height ? metadata.height : 512;
- stick.width = metadata && metadata.width ? metadata.width : 512;
-
- await stick.initialize();
-
- var result =
- (await stick.sendToChat(chat, {
- stickerIsFirstParty: false,
- stickerSendOrigin: 6,
- })) || '';
- var m = { type: type },
- obj,
- To = await WAPI.getchatId(chat.id);
- if (result === 'OK') {
- obj = WAPI.scope(To, false, result, null);
- Object.assign(obj, m);
- return obj;
- } else {
- obj = WAPI.scope(To, true, result, null);
- Object.assign(obj, m);
- return obj;
- }
- } else {
- return chat;
- }
-}
diff --git a/src/lib/wapi/functions/sendMessageOptions.js b/src/lib/wapi/functions/sendMessageOptions.js
index 881aac28a..45b2df31a 100644
--- a/src/lib/wapi/functions/sendMessageOptions.js
+++ b/src/lib/wapi/functions/sendMessageOptions.js
@@ -113,9 +113,7 @@ export async function sendMessageOptions(chatId, content, options = {}) {
delete options.linkPreview;
const link = await window.Store.Validators.findLink(content);
if (link && !WPP.conn.isMultiDevice()) {
- const preview = await window.Store.Wap2.default.queryLinkPreview(
- link.url
- );
+ const preview = await WPP.whatsapp.functions.queryLinkPreview(link.url);
preview.preview = true;
preview.subtype = 'url';
options = { ...options, ...preview };
diff --git a/src/lib/wapi/store/store-objects.js b/src/lib/wapi/store/store-objects.js
index fbad74730..1e4876eb5 100644
--- a/src/lib/wapi/store/store-objects.js
+++ b/src/lib/wapi/store/store-objects.js
@@ -36,33 +36,6 @@ export const storeObjects = [
id: 'GroupInvite',
conditions: (module) => (module.sendQueryGroupInviteCode ? module : null),
},
- {
- id: 'ServiceWorker',
- conditions: (module) =>
- module.default && module.default.killServiceWorker ? module : null,
- },
- {
- id: 'WapQuery',
- conditions: (module) =>
- module.default &&
- module.default.queryExist &&
- module.default.getCapabilities
- ? module.default
- : null,
- },
- {
- id: 'CryptoLib',
- conditions: (module) => (module.decryptE2EMedia ? module : null),
- },
- {
- id: 'OpenChat',
- conditions: (module) =>
- module.default &&
- module.default.prototype &&
- module.default.prototype.openChat
- ? module.default
- : null,
- },
{
id: 'Archive',
conditions: (module) => (module.setArchive ? module : null),
@@ -81,21 +54,6 @@ export const storeObjects = [
? module
: null,
},
- {
- id: 'Parser',
- conditions: (module) =>
- module.convertToTextWithoutSpecialEmojis ? module.default : null,
- },
- {
- id: 'Builders',
- conditions: (module) =>
- module.TemplateMessage && module.HydratedFourRowTemplate ? module : null,
- },
- {
- id: 'CallUtils',
- conditions: (module) =>
- module.sendCallEnd && module.parseCall ? module : null,
- },
{
id: 'Identity',
conditions: (module) =>
@@ -110,57 +68,6 @@ export const storeObjects = [
? module
: null,
},
- {
- id: 'MessageUtils',
- conditions: (module) =>
- module.storeMessages && module.appendMessage ? module : null,
- },
- {
- id: 'WebMessageInfo',
- conditions: (module) =>
- module.WebMessageInfo && module.WebFeatures
- ? module.WebMessageInfo
- : null,
- },
- {
- id: 'createMessageKey',
- conditions: (module) =>
- module.createMessageKey && module.createDeviceSentMessage
- ? module.createMessageKey
- : null,
- },
- {
- id: 'Base',
- conditions: (module) =>
- module.setSubProtocol && module.binSend && module.actionNode
- ? module
- : null,
- },
- {
- id: 'Base2',
- conditions: (module) =>
- module.supportsFeatureFlags &&
- module.parseMsgStubProto &&
- module.binSend &&
- module.subscribeLiveLocation
- ? module
- : null,
- },
- {
- id: 'Versions',
- conditions: (module) =>
- module.loadProtoVersions &&
- module.default['15'] &&
- module.default['16'] &&
- module.default['17']
- ? module
- : null,
- },
- {
- id: 'Sticker',
- conditions: (module) =>
- module.StickerCollection && module.default ? module : null,
- },
{
id: 'MediaObject',
conditions: (module) =>
@@ -191,20 +98,6 @@ export const storeObjects = [
id: 'Validators',
conditions: (module) => (module.findLinks ? module : null),
},
- {
- id: 'Wap2',
- conditions: (module) => (module.Wap ? module : null),
- },
- {
- id: 'Stream',
- conditions: (module) =>
- module.default && module.default.unobscure ? module.default : null,
- },
- {
- id: 'ws2',
- conditions: (module) =>
- module.default && module.default.destroyStorage ? module.default : null,
- },
{
id: 'sendSetGroupSubject',
conditions: (module) => module.sendSetGroupSubject,
diff --git a/src/lib/wapi/wapi.js b/src/lib/wapi/wapi.js
index 624691596..5495d18ce 100644
--- a/src/lib/wapi/wapi.js
+++ b/src/lib/wapi/wapi.js
@@ -63,20 +63,16 @@ import {
sendFile,
sendPtt,
sendImage,
- sendImageAsSticker,
sendImageWithProduct,
sendLocation,
sendMessage,
sendMessage2,
sendMessageWithTags,
sendMessageWithThumb,
- sendSticker,
sendVideoAsGif,
setMyName,
getTheme,
setTheme,
- restartService,
- killServiceWorker,
sendLinkPreview,
scope,
getchatId,
@@ -145,6 +141,12 @@ if (typeof window.Store === 'undefined') {
window.Store.promises[store.id] = Promise.resolve(
WPP.webpack.search(store.conditions)
)
+ .then((m) => {
+ if (!m) {
+ console.error(`Store Object '${store.id}' was not found`);
+ }
+ return m;
+ })
.then(store.conditions)
.then((m) => {
if (store.id === 'Store') {
@@ -202,10 +204,7 @@ if (typeof window.WAPI === 'undefined') {
window.WAPI.processFiles = processFiles;
window.WAPI.sendImageWithProduct = sendImageWithProduct;
window.WAPI.forwardMessages = forwardMessages;
- window.WAPI._sendSticker = sendSticker;
window.WAPI.encryptAndUploadFile = encryptAndUploadFile;
- window.WAPI.sendImageAsSticker = sendImageAsSticker;
- window.WAPI.sendImageAsStickerGif = sendImageAsSticker;
window.WAPI.setOnlinePresence = setOnlinePresence;
window.WAPI.sendLocation = sendLocation;
window.WAPI.sendLinkPreview = sendLinkPreview;
@@ -260,8 +259,6 @@ if (typeof window.WAPI === 'undefined') {
window.WAPI.getBatteryLevel = getBatteryLevel;
window.WAPI.base64ImageToFile = base64ToFile;
window.WAPI.base64ToFile = base64ToFile;
- window.WAPI.restartService = restartService;
- window.WAPI.killServiceWorker = killServiceWorker;
window.WAPI.sendMute = sendMute;
window.WAPI.startPhoneWatchdog = startPhoneWatchdog;
window.WAPI.stopPhoneWatchdog = stopPhoneWatchdog;
diff --git a/src/types/WAPI.d.ts b/src/types/WAPI.d.ts
index 36f5299c1..bdce80f46 100644
--- a/src/types/WAPI.d.ts
+++ b/src/types/WAPI.d.ts
@@ -84,7 +84,6 @@ interface WAPI {
isLoggedIn: () => boolean;
isRegistered: () => boolean;
joinGroup: (groupId: string) => Promise;
- killServiceWorker: () => boolean;
leaveGroup: (groupId: string) => any;
loadAndGetAllMessagesInChat: (
chatId: string,
@@ -108,7 +107,6 @@ interface WAPI {
nonExistent?: boolean
) => Promise