From 538d3e4da73e87b0163b76f3ecc8801bfd51daa9 Mon Sep 17 00:00:00 2001 From: Rajeh Taher Date: Sun, 7 Sep 2025 14:29:45 +0300 Subject: [PATCH] move to create instead of fromObject --- Example/example.ts | 2 +- src/Socket/chats.ts | 2 +- src/__tests__/binary/connection-deadlock.test.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Example/example.ts b/Example/example.ts index e7282cb6..c12206fe 100644 --- a/Example/example.ts +++ b/Example/example.ts @@ -247,7 +247,7 @@ const startSock = async() => { // up to you // only if store is present - return proto.Message.fromObject({ conversation: 'test' }) + return proto.Message.create({ conversation: 'test' }) } } diff --git a/src/Socket/chats.ts b/src/Socket/chats.ts index 939bb20e..ea743452 100644 --- a/src/Socket/chats.ts +++ b/src/Socket/chats.ts @@ -1157,7 +1157,7 @@ export const makeChatsSocket = (config: SocketConfig) => { ev.buffer() const willSyncHistory = shouldSyncHistoryMessage( - proto.Message.HistorySyncNotification.fromObject({ + proto.Message.HistorySyncNotification.create({ syncType: proto.HistorySync.HistorySyncType.RECENT }) ) diff --git a/src/__tests__/binary/connection-deadlock.test.ts b/src/__tests__/binary/connection-deadlock.test.ts index 0399e522..0c6bc6bd 100644 --- a/src/__tests__/binary/connection-deadlock.test.ts +++ b/src/__tests__/binary/connection-deadlock.test.ts @@ -26,7 +26,7 @@ describe('Connection Deadlock Test', () => { // 2. Now, emit a regular message. Because the previous step should have // flushed the buffer, this message should be processed immediately. - const regularMessage = proto.WebMessageInfo.fromObject({ + const regularMessage = proto.WebMessageInfo.create({ key: { remoteJid: '1234567890@s.whatsapp.net', fromMe: false, id: 'REGULAR_MSG_1' }, messageTimestamp: Date.now() / 1000, message: { conversation: 'Hello, world!' }