-
-
Save Santosl2/4f2ee95b338652fe40ff2eb8f55b856c to your computer and use it in GitHub Desktop.
Monitor Socket messages on 2.3000x and above
This file contains hidden or 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, result); | |
| 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, args[0]); | |
| return result; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment