Skip to content

Commit cf63498

Browse files
committed
conversion to string of protocol **type**.
1 parent 3515fa1 commit cf63498

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"start:prod": "cross-env NODE_ENV=prod bash start.sh",
1010
"start:dev": "cross-env NODE_ENV=dev tsnd --files --transpile-only --respawn --ignore-watch node_modules ./src/main.ts",
1111
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
12-
"test": "clear && tsnd --files --transpile-only --respawn --ignore-watch node_modules ./test/all.test.ts"
12+
"test": "cls && tsnd --files --transpile-only --respawn --ignore-watch node_modules ./test/all.test.ts"
1313
},
1414
"repository": {
1515
"type": "git",

src/whatsapp/services/whatsapp.service.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -881,6 +881,16 @@ export class WAStartupService {
881881
} as any;
882882
}
883883

884+
if (received.message?.protocolMessage) {
885+
const m = received.message.protocolMessage;
886+
if (typeof m?.type === 'number') {
887+
const typeName =
888+
proto.Message.ProtocolMessage.Type[m.type as any] ?? 'UNKNOWN_TYPE';
889+
m.type = typeName as any;
890+
received.message.protocolMessage = m;
891+
}
892+
}
893+
884894
const messageRaw = {
885895
keyId: received.key.id,
886896
keyRemoteJid: this.normalizeJid(received.key),

0 commit comments

Comments
 (0)