mirror of
https://github.com/cheveguerra/whatsapp-web.js.git
synced 2026-04-18 19:49:16 +00:00
feat: Add support to suspicious links (#642)
This commit is contained in:
@@ -200,7 +200,8 @@ class Message extends Base {
|
||||
|
||||
/**
|
||||
* Links included in the message.
|
||||
* @type {Array<string>}
|
||||
* @type {Array<{link: string, isSuspicious: boolean}>}
|
||||
*
|
||||
*/
|
||||
this.links = data.links;
|
||||
|
||||
|
||||
@@ -264,8 +264,7 @@ exports.LoadUtils = () => {
|
||||
const msg = message.serialize();
|
||||
|
||||
msg.isStatusV3 = message.isStatusV3;
|
||||
msg.links = (message.getLinks()).map(link => link.href);
|
||||
|
||||
msg.links = (message.getLinks()).map(link => ({ link: link.href, isSuspicious: link.suspiciousCharacters?.size ? true : false}));
|
||||
if (msg.buttons) {
|
||||
msg.buttons = msg.buttons.serialize();
|
||||
}
|
||||
@@ -275,6 +274,7 @@ exports.LoadUtils = () => {
|
||||
return msg;
|
||||
};
|
||||
|
||||
|
||||
window.WWebJS.getChatModel = async chat => {
|
||||
let res = chat.serialize();
|
||||
res.isGroup = chat.isGroup;
|
||||
|
||||
Reference in New Issue
Block a user