-
-
Save A-d-i-t-h-y-a-n/36637f6d8b99664f6a46073318e06f91 to your computer and use it in GitHub Desktop.
Monitor Socket messages on 2.3000x and above
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (!window.decodeBackStanza) { | |
window.decodeBackStanza = require("WAWap").decodeStanza; | |
window.encodeBackStanza = require("WAWap").encodeStanza; | |
} | |
require("WAWap").decodeStanza = async (e, t) => { | |
const result = await window.decodeBackStanza(e, t); | |
console.log('[INFO] coming from whatsapp, tag:' + result.tag + ' , xmlns:' + result.attrs?.xmlns + ' , type:' + result.attrs?.type, JSON.stringify(result, undefined, 2)); | |
return result; | |
} | |
require("WAWap").encodeStanza = (...args) => { | |
const result = window.encodeBackStanza(...args); | |
console.log('[INFO] going to whatsapp, tag:' + args[0].tag + ' , xmlns:' + args[0].attrs?.xmlns + ' , type:' + args[0].attrs?.type, JSON.stringify(args[0], undefined, 2)); | |
return result; | |
} |
just do .toString()
Aah
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
just do .toString()