fix: link retrieval from message (#2716)

* fix: fix links retrieving from message

* docs: fix Message.links property type

* refactor: revert bracking changes
This commit is contained in:
alechkos 2024-01-14 08:45:33 +02:00 • committed by GitHub
commit bd7cf9b463
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -923,7 +923,7 @@ class Client extends EventEmitter {
}
const msg = await window.WWebJS.sendMessage(chat, message, options, sendSeen);
return msg.serialize();
return window.WWebJS.getMessageModel(msg);
}, chatId, content, internalOptions, sendSeen);
return new Message(this, newMessage);

View file

@ -532,7 +532,7 @@ exports.LoadUtils = () => {
msg.isEphemeral = message.isEphemeral;
msg.isStatusV3 = message.isStatusV3;
msg.links = (message.getRawLinks()).map(link => ({
msg.links = (window.Store.Validators.findLinks(message.mediaObject ? message.caption : message.body)).map((link) => ({
link: link.href,
isSuspicious: Boolean(link.suspiciousCharacters && link.suspiciousCharacters.size)
}));