From e915342eed15ef49d2d9efa65d3efde54b4d1217 Mon Sep 17 00:00:00 2001 From: Adhiraj Date: Mon, 3 Aug 2020 17:22:29 +0530 Subject: [PATCH] Fix export issue --- src/WAClient/Constants.ts | 6 +++--- src/WAConnection/BrowserMessageDecoding.ts | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/WAClient/Constants.ts b/src/WAClient/Constants.ts index 3383645..77a1302 100644 --- a/src/WAClient/Constants.ts +++ b/src/WAClient/Constants.ts @@ -100,7 +100,7 @@ export interface MessageStatusUpdate { /** Message IDs read/delivered */ ids: string[] /** Status of the Message IDs */ - type: proto.WebMessageInfo.WEB_MESSAGE_INFO_STATUS + type: WA_MESSAGE_STATUS_TYPE } export enum GroupSettingChange { messageSend = 'announcement', @@ -139,8 +139,8 @@ export interface WALocationMessage { degreesLongitude: number address?: string } -export const WA_MESSAGE_STUB_TYPE = proto.WebMessageInfo.WEB_MESSAGE_INFO_STUBTYPE -export const WA_MESSAGE_STATUS_TYPE = proto.WebMessageInfo.WEB_MESSAGE_INFO_STATUS +export import WA_MESSAGE_STUB_TYPE = proto.WebMessageInfo.WEB_MESSAGE_INFO_STUBTYPE +export import WA_MESSAGE_STATUS_TYPE = proto.WebMessageInfo.WEB_MESSAGE_INFO_STATUS /** Reverse stub type dictionary */ export const WAMessageType = function () { diff --git a/src/WAConnection/BrowserMessageDecoding.ts b/src/WAConnection/BrowserMessageDecoding.ts index cb00ddc..30abf84 100644 --- a/src/WAConnection/BrowserMessageDecoding.ts +++ b/src/WAConnection/BrowserMessageDecoding.ts @@ -37,6 +37,7 @@ console.log ('parsing ' + wsMessages.length + ' messages') const list = wsMessages.map ((item, i) => { const buffer = Buffer.from (item.data, 'base64') try { + const [tag, json, binaryTags] = decrypt (buffer) return {tag, json: JSON.stringify(json), binaryTags} } catch (error) { @@ -44,7 +45,7 @@ const list = wsMessages.map ((item, i) => { const [tag, json, binaryTags] = decrypt (item.data) return {tag, json: JSON.stringify(json), binaryTags} } catch (error) { - console.log ('error in decoding: ' + error) + console.log ('error in decoding: ' + item.data + ': ' + error) return null }