Skip to content

Commit 982caaf

Browse files
committed
Changes to convert to whatsapp-web.js editor config style
1 parent 6069c92 commit 982caaf

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
@@ -723,8 +723,12 @@ class Client extends EventEmitter {
723723
/** @type {GroupNotification} object does not provide enough information about this event, so a @type {Message} object is used. */
724724
const message = new Message(this, msg);
725725

726-
const newId = isParticipant ? msg.recipients[0] : msg._data.templateParams[1];
727-
const oldId = isParticipant ? msg.author : msg._data.templateParams[0];
726+
const newId = isParticipant
727+
? msg.recipients[0]
728+
: msg._data.templateParams[1];
729+
const oldId = isParticipant
730+
? msg.author
731+
: msg._data.templateParams[0];
728732

729733
/**
730734
* Emitted when a contact or a group participant changes their phone number.
@@ -1379,8 +1383,8 @@ class Client extends EventEmitter {
13791383
content instanceof Buttons,
13801384
content instanceof List,
13811385
Array.isArray(content) &&
1382-
content.length > 0 &&
1383-
content[0] instanceof Contact,
1386+
content.length > 0 &&
1387+
content[0] instanceof Contact,
13841388
].includes(true)
13851389
) {
13861390
console.warn(
@@ -1401,8 +1405,8 @@ class Client extends EventEmitter {
14011405
content instanceof Buttons,
14021406
content instanceof List,
14031407
Array.isArray(content) &&
1404-
content.length > 0 &&
1405-
content[0] instanceof Contact,
1408+
content.length > 0 &&
1409+
content[0] instanceof Contact,
14061410
].includes(true)
14071411
) {
14081412
console.warn(
@@ -1757,10 +1761,10 @@ class Client extends EventEmitter {
17571761
return !pinnedMsgs.length
17581762
? []
17591763
: await Promise.all(
1760-
pinnedMsgs.map((msg) =>
1761-
window.WWebJS.getMessageModel(msg),
1762-
),
1763-
);
1764+
pinnedMsgs.map((msg) =>
1765+
window.WWebJS.getMessageModel(msg),
1766+
),
1767+
);
17641768
}, chatId);
17651769

17661770
return pinnedMsgs.map((msg) => new Message(this, msg));
@@ -2062,9 +2066,9 @@ class Client extends EventEmitter {
20622066
.Chat.find(chatId));
20632067
action === 'MUTE'
20642068
? await chat.mute.mute({
2065-
expiration: unmuteDateTs,
2066-
sendDevice: true,
2067-
})
2069+
expiration: unmuteDateTs,
2070+
sendDevice: true,
2071+
})
20682072
: await chat.mute.unmute({ sendDevice: true });
20692073
return {
20702074
isMuted: chat.mute.expiration !== 0,
@@ -2348,9 +2352,9 @@ class Client extends EventEmitter {
23482352
window
23492353
.require('WAWebCollections')
23502354
.Chat.get(participant.wid) ||
2351-
(await window
2352-
.require('WAWebCollections')
2353-
.Chat.find(participant.wid)),
2355+
(await window
2356+
.require('WAWebCollections')
2357+
.Chat.find(participant.wid)),
23542358
createGroupResult.wid._serialized,
23552359
createGroupResult.subject,
23562360
participant.invite_code,
@@ -2615,11 +2619,11 @@ class Client extends EventEmitter {
26152619

26162620
countryCodes =
26172621
countryCodes.length === 1 &&
2618-
countryCodes[0] === currentRegion
2622+
countryCodes[0] === currentRegion
26192623
? countryCodes
26202624
: countryCodes.filter((code) =>
2621-
Object.keys(countryCodesIso).includes(code),
2622-
);
2625+
Object.keys(countryCodesIso).includes(code),
2626+
);
26232627

26242628
const viewTypeMapping = {
26252629
0: 'RECOMMENDED',
@@ -2658,12 +2662,12 @@ class Client extends EventEmitter {
26582662

26592663
return channels
26602664
? await Promise.all(
2661-
channels.map((channel) =>
2662-
window.WWebJS.getChatModel(channel, {
2663-
isChannel: true,
2664-
}),
2665-
),
2666-
)
2665+
channels.map((channel) =>
2666+
window.WWebJS.getChatModel(channel, {
2667+
isChannel: true,
2668+
}),
2669+
),
2670+
)
26672671
: [];
26682672
},
26692673
searchOptions,

0 commit comments

Comments
 (0)