From 2696af4da1fa62639ea60043b3b33837412d9f9b Mon Sep 17 00:00:00 2001 From: Adhiraj Singh Date: Sun, 19 Dec 2021 00:35:15 +0530 Subject: [PATCH] fix: catch unknown user action --- src/LegacySocket/chats.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/LegacySocket/chats.ts b/src/LegacySocket/chats.ts index f093d9b..fe01273 100644 --- a/src/LegacySocket/chats.ts +++ b/src/LegacySocket/chats.ts @@ -252,9 +252,13 @@ const makeChatsSocket = (config: LegacySocketConfig) => { socketEvents.on('CB:action,,user', (json: BinaryNode) => { if(Array.isArray(json.content)) { const user = json.content[0].attrs - user.id = jidNormalizedUser(user.id) + if(user.id) { + user.id = jidNormalizedUser(user.id) - //ev.emit('contacts.upsert', [user]) + //ev.emit('contacts.upsert', [user]) + } else { + logger.warn({ json }, 'recv unknown action') + } } })