extra options can override other options when sending message (#1103)

* Fix the option to use special options

When we want to use some extra function we need to pass it into the options object, but because it inserted in the first line, the auto options reset some options (like 'type').
This is minor change that can help to add functionallity

* Update Injected.js

Put the special options in the end

* Update Injected.js

Fix , mistake

* only `extra` options can override everything else

Co-authored-by: Pedro Lopez <pedroslopez@me.com>
This commit is contained in:
Shir Serlui 2022-02-07 03:00:10 +02:00 • committed by GitHub
commit 7e36cceaf0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -540,7 +540,7 @@ class Client extends EventEmitter {
quotedMessageId: options.quotedMessageId,
parseVCards: options.parseVCards === false ? false : true,
mentionedJidList: Array.isArray(options.mentions) ? options.mentions.map(contact => contact.id._serialized) : [],
...options.extra
extraOptions: options.extra
};
const sendSeen = typeof options.sendSeen === 'undefined' ? true : options.sendSeen;