Skip to content

Commit a71c228

Browse files
committed
Changes to convert to whatsapp-web.js editor config style
1 parent 5bfba15 commit a71c228

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.
@@ -1396,8 +1400,8 @@ class Client extends EventEmitter {
13961400
content instanceof Buttons,
13971401
content instanceof List,
13981402
Array.isArray(content) &&
1399-
content.length > 0 &&
1400-
content[0] instanceof Contact,
1403+
content.length > 0 &&
1404+
content[0] instanceof Contact,
14011405
].includes(true)
14021406
) {
14031407
console.warn(
@@ -1418,8 +1422,8 @@ class Client extends EventEmitter {
14181422
content instanceof Buttons,
14191423
content instanceof List,
14201424
Array.isArray(content) &&
1421-
content.length > 0 &&
1422-
content[0] instanceof Contact,
1425+
content.length > 0 &&
1426+
content[0] instanceof Contact,
14231427
].includes(true)
14241428
) {
14251429
console.warn(
@@ -1801,10 +1805,10 @@ class Client extends EventEmitter {
18011805
return !pinnedMsgs.length
18021806
? []
18031807
: await Promise.all(
1804-
pinnedMsgs.map((msg) =>
1805-
window.WWebJS.getMessageModel(msg),
1806-
),
1807-
);
1808+
pinnedMsgs.map((msg) =>
1809+
window.WWebJS.getMessageModel(msg),
1810+
),
1811+
);
18081812
}, chatId);
18091813

18101814
return pinnedMsgs.map((msg) => new Message(this, msg));
@@ -2106,9 +2110,9 @@ class Client extends EventEmitter {
21062110
.Chat.find(chatId));
21072111
action === 'MUTE'
21082112
? await chat.mute.mute({
2109-
expiration: unmuteDateTs,
2110-
sendDevice: true,
2111-
})
2113+
expiration: unmuteDateTs,
2114+
sendDevice: true,
2115+
})
21122116
: await chat.mute.unmute({ sendDevice: true });
21132117
return {
21142118
isMuted: chat.mute.expiration !== 0,
@@ -2392,9 +2396,9 @@ class Client extends EventEmitter {
23922396
window
23932397
.require('WAWebCollections')
23942398
.Chat.get(participant.wid) ||
2395-
(await window
2396-
.require('WAWebCollections')
2397-
.Chat.find(participant.wid)),
2399+
(await window
2400+
.require('WAWebCollections')
2401+
.Chat.find(participant.wid)),
23982402
createGroupResult.wid._serialized,
23992403
createGroupResult.subject,
24002404
participant.invite_code,
@@ -2659,11 +2663,11 @@ class Client extends EventEmitter {
26592663

26602664
countryCodes =
26612665
countryCodes.length === 1 &&
2662-
countryCodes[0] === currentRegion
2666+
countryCodes[0] === currentRegion
26632667
? countryCodes
26642668
: countryCodes.filter((code) =>
2665-
Object.keys(countryCodesIso).includes(code),
2666-
);
2669+
Object.keys(countryCodesIso).includes(code),
2670+
);
26672671

26682672
const viewTypeMapping = {
26692673
0: 'RECOMMENDED',
@@ -2702,12 +2706,12 @@ class Client extends EventEmitter {
27022706

27032707
return channels
27042708
? await Promise.all(
2705-
channels.map((channel) =>
2706-
window.WWebJS.getChatModel(channel, {
2707-
isChannel: true,
2708-
}),
2709-
),
2710-
)
2709+
channels.map((channel) =>
2710+
window.WWebJS.getChatModel(channel, {
2711+
isChannel: true,
2712+
}),
2713+
),
2714+
)
27112715
: [];
27122716
},
27132717
searchOptions,

0 commit comments

Comments
 (0)