Skip to content

Commit e6185f4

Browse files
committed
Changes to convert to whatsapp-web.js editor config style
1 parent 2bb180c commit e6185f4

1 file changed

Lines changed: 29 additions & 25 deletions

File tree

src/Client.js

Lines changed: 29 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -700,8 +700,12 @@ class Client extends EventEmitter {
700700
/** @type {GroupNotification} object does not provide enough information about this event, so a @type {Message} object is used. */
701701
const message = new Message(this, msg);
702702

703-
const newId = isParticipant ? msg.recipients[0] : msg._data.templateParams[1];
704-
const oldId = isParticipant ? msg.author : msg._data.templateParams[0];
703+
const newId = isParticipant
704+
? msg.recipients[0]
705+
: msg._data.templateParams[1];
706+
const oldId = isParticipant
707+
? msg.author
708+
: msg._data.templateParams[0];
705709

706710
/**
707711
* Emitted when a contact or a group participant changes their phone number.
@@ -1300,8 +1304,8 @@ class Client extends EventEmitter {
13001304
content instanceof Buttons,
13011305
content instanceof List,
13021306
Array.isArray(content) &&
1303-
content.length > 0 &&
1304-
content[0] instanceof Contact,
1307+
content.length > 0 &&
1308+
content[0] instanceof Contact,
13051309
].includes(true)
13061310
) {
13071311
console.warn(
@@ -1322,8 +1326,8 @@ class Client extends EventEmitter {
13221326
content instanceof Buttons,
13231327
content instanceof List,
13241328
Array.isArray(content) &&
1325-
content.length > 0 &&
1326-
content[0] instanceof Contact,
1329+
content.length > 0 &&
1330+
content[0] instanceof Contact,
13271331
].includes(true)
13281332
) {
13291333
console.warn(
@@ -1678,10 +1682,10 @@ class Client extends EventEmitter {
16781682
return !pinnedMsgs.length
16791683
? []
16801684
: await Promise.all(
1681-
pinnedMsgs.map((msg) =>
1682-
window.WWebJS.getMessageModel(msg),
1683-
),
1684-
);
1685+
pinnedMsgs.map((msg) =>
1686+
window.WWebJS.getMessageModel(msg),
1687+
),
1688+
);
16851689
}, chatId);
16861690

16871691
return pinnedMsgs.map((msg) => new Message(this, msg));
@@ -1983,9 +1987,9 @@ class Client extends EventEmitter {
19831987
.Chat.find(chatId));
19841988
action === 'MUTE'
19851989
? await chat.mute.mute({
1986-
expiration: unmuteDateTs,
1987-
sendDevice: true,
1988-
})
1990+
expiration: unmuteDateTs,
1991+
sendDevice: true,
1992+
})
19891993
: await chat.mute.unmute({ sendDevice: true });
19901994
return {
19911995
isMuted: chat.mute.expiration !== 0,
@@ -2269,9 +2273,9 @@ class Client extends EventEmitter {
22692273
window
22702274
.require('WAWebCollections')
22712275
.Chat.get(participant.wid) ||
2272-
(await window
2273-
.require('WAWebCollections')
2274-
.Chat.find(participant.wid)),
2276+
(await window
2277+
.require('WAWebCollections')
2278+
.Chat.find(participant.wid)),
22752279
createGroupResult.wid._serialized,
22762280
createGroupResult.subject,
22772281
participant.invite_code,
@@ -2536,11 +2540,11 @@ class Client extends EventEmitter {
25362540

25372541
countryCodes =
25382542
countryCodes.length === 1 &&
2539-
countryCodes[0] === currentRegion
2543+
countryCodes[0] === currentRegion
25402544
? countryCodes
25412545
: countryCodes.filter((code) =>
2542-
Object.keys(countryCodesIso).includes(code),
2543-
);
2546+
Object.keys(countryCodesIso).includes(code),
2547+
);
25442548

25452549
const viewTypeMapping = {
25462550
0: 'RECOMMENDED',
@@ -2579,12 +2583,12 @@ class Client extends EventEmitter {
25792583

25802584
return channels
25812585
? await Promise.all(
2582-
channels.map((channel) =>
2583-
window.WWebJS.getChatModel(channel, {
2584-
isChannel: true,
2585-
}),
2586-
),
2587-
)
2586+
channels.map((channel) =>
2587+
window.WWebJS.getChatModel(channel, {
2588+
isChannel: true,
2589+
}),
2590+
),
2591+
)
25882592
: [];
25892593
},
25902594
searchOptions,

0 commit comments

Comments
 (0)