Skip to content

Commit

Permalink
fix: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
jonalan7 committed Jul 9, 2021
1 parent 4c7becd commit 81568ed
Show file tree
Hide file tree
Showing 30 changed files with 1,002 additions and 874 deletions.
1,788 changes: 958 additions & 830 deletions src/lib/jsQR/jsQR.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/lib/wapi/business/send-payment-request.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ window.WAPI.sendPaymentRequest = async function (
noteMessage,
expiryTimestamp: parseInt(
new Date(new Date().setDate(new Date().getDate() + 1)).getTime() / 1000
),
)
};
Object.assign(tempMsg, extend);
await Store.addAndSendMsgToChat(chat, tempMsg);
Expand Down
6 changes: 3 additions & 3 deletions src/lib/wapi/functions/check-send-exist.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export function scope(id, erro, status, text = null) {
to: id,
erro: erro,
text: text,
status: status,
status: status
};
return e;
}
Expand All @@ -72,7 +72,7 @@ export async function getchatId(chatId) {
isMyContact: to.contact.isMyContact,
verifiedName: to.contact.verifiedName,
pushname: to.contact.pushname,
isOnline: to.isOnline,
isOnline: to.isOnline
};
Object.assign(objTo, extend);
return objTo;
Expand Down Expand Up @@ -144,7 +144,7 @@ export async function sendExist(chatId, returnChat = true, Send = true) {

if (ck.numberExists && chat === undefined) {
var idUser = new window.Store.UserConstructor(chatId, {
intentionallyUsePrivateConstructor: true,
intentionallyUsePrivateConstructor: true
});
chat = await Store.Chat.find(idUser);
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/wapi/functions/delete-conversation.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
*/
export function deleteConversation(chatId, done) {
let userId = new window.Store.UserConstructor(chatId, {
intentionallyUsePrivateConstructor: true,
intentionallyUsePrivateConstructor: true
});
let conversation = WAPI.getChat(userId);

Expand Down
2 changes: 1 addition & 1 deletion src/lib/wapi/functions/delete-messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export async function deleteMessages(chatId, messageArray) {
chat.sendDeleteMsgs(
messagesToDelete.filter((msg) => !msg.fromMe),
chat
),
)
];

const result = (await Promise.all(jobs))[1];
Expand Down
6 changes: 3 additions & 3 deletions src/lib/wapi/functions/download-media.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,14 @@ export async function downloadMedia(messageId) {
throw {
error: true,
code: 'message_not_found',
message: 'Message not found',
message: 'Message not found'
};
}
if (!msg.mediaData) {
throw {
error: true,
code: 'message_not_contains_media',
message: 'Message not contains media',
message: 'Message not contains media'
};
}

Expand All @@ -91,7 +91,7 @@ export async function downloadMedia(messageId) {
throw {
error: true,
code: 'media_not_found',
message: 'Media not found',
message: 'Media not found'
};
}

Expand Down
4 changes: 2 additions & 2 deletions src/lib/wapi/functions/encrypt-and-upload-file.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,14 @@ export async function encryptAndUploadFile(type, blob) {
blob,
type,
signal,
mediaKey,
mediaKey
});
return {
...encrypted,
clientUrl: encrypted.url,
filehash,
id: filehash,
uploadhash: encrypted.encFilehash,
mediaBlob: blob,
mediaBlob: blob
};
}
2 changes: 1 addition & 1 deletion src/lib/wapi/functions/fix-chat.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export async function pinChat(chatId, type = true, notExist = false) {
if (!chat.erro) {
var m = {
type: 'pinChat',
typefix: typeFix,
typefix: typeFix
},
To = await WAPI.getchatId(chat.id);
await Store.pinChat
Expand Down
2 changes: 1 addition & 1 deletion src/lib/wapi/functions/forward-messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export async function forwardMessages(chatId, messages, skipMyMessages) {
isForwarded: true,
forwardingScore: 1,
multicast: true,
__x_isSentByMe: true,
__x_isSentByMe: true
};

Object.assign(tempMsg, toFor);
Expand Down
2 changes: 1 addition & 1 deletion src/lib/wapi/functions/get-chat.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export function getChat(id) {
let found = Store.Chat.get(id);
if (!found) {
const ConstructChat = new window.Store.UserConstructor(id, {
intentionallyUsePrivateConstructor: !0,
intentionallyUsePrivateConstructor: !0
});
found = Store.Chat.find(ConstructChat) || false;
}
Expand Down
4 changes: 2 additions & 2 deletions src/lib/wapi/functions/get-list-mute.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ export async function getListMute(type = 'all') {
{
total: toMute.length + noMute.length,
amountToMute: toMute.length,
amountnoMute: noMute.length,
amountnoMute: noMute.length
},
toMute,
noMute,
noMute
];
break;
case 'toMute':
Expand Down
2 changes: 1 addition & 1 deletion src/lib/wapi/functions/get-number-profile.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export async function getNumberProfile(id, done) {
done(
window.WAPI._serializeNumberStatusObj({
status: e,
jid: id,
jid: id
})
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/wapi/functions/get-session-token.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export async function getSessionTokenBrowser() {
WABrowserId,
WASecretBundle,
WAToken1,
WAToken2,
WAToken2
};
}
}
2 changes: 1 addition & 1 deletion src/lib/wapi/functions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export { isLoggedIn } from './is-logged-in';
export { leaveGroup } from './leave-group';
export {
asyncLoadAllEarlierMessages,
loadAllEarlierMessages,
loadAllEarlierMessages
} from './load-all-earlier-chat-messages';
export { loadAndGetAllMessagesInChat } from './load-and-get-all-messages-in-chat';
export { loadChatEarlierMessages } from './load-earlier-chat-messages';
Expand Down
2 changes: 1 addition & 1 deletion src/lib/wapi/functions/open-chat.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export async function openChatAt(chatId, messageId) {
const args = {
collection: chat.msgs,
msg: atMessage,
isUnreadDivider: false,
isUnreadDivider: false
};
const result = await Store.Cmd.default._openChat(chat, args);
return result;
Expand Down
4 changes: 2 additions & 2 deletions src/lib/wapi/functions/process-files.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,15 @@ export async function processFiles(chat, blobs) {
blobs = [blobs];
}
const mediaCollection = new Store.MediaCollection({
chatParticipantCount: chat.getParticipantCount(),
chatParticipantCount: chat.getParticipantCount()
});

await mediaCollection.processAttachments(
Debug.VERSION === '0.4.613'
? blobs
: blobs.map((blob) => {
return {
file: blob,
file: blob
};
}),
chat,
Expand Down
2 changes: 1 addition & 1 deletion src/lib/wapi/functions/reply.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export async function reply(chatId, content, quotedMessageId) {
t: parseInt(new Date().getTime() / 1000),
isNewMsg: !0,
type: 'chat',
...quotedMsgOptions,
...quotedMsgOptions
};

const result = (
Expand Down
2 changes: 1 addition & 1 deletion src/lib/wapi/functions/send-contact-vcard-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export async function sendContactVcardList(chatId, contacts) {
to: chatId,
type: 'multi_vcard',
vcardList: Vcards,
isNewMsg: !0,
isNewMsg: !0
};

var result =
Expand Down
2 changes: 1 addition & 1 deletion src/lib/wapi/functions/send-contact-vcard.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export async function sendContactVcard(chatId, contact, name) {
isNewMsg: true,
t: parseInt(new Date().getTime() / 1000),
to: chat.id,
type: 'vcard',
type: 'vcard'
};

const result = (
Expand Down
6 changes: 3 additions & 3 deletions src/lib/wapi/functions/send-image-with-product.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export function sendImageWithProduct(
const temp = {
productMsgOptions: {
businessOwnerJid: product.catalogWid.toString({
legacy: !0,
legacy: !0
}),
productId: product.id.toString(),
url: product.url,
Expand All @@ -87,9 +87,9 @@ export function sendImageWithProduct(
description: product.description,
currencyCode: product.currency,
priceAmount1000: product.priceAmount1000,
type: 'product',
type: 'product'
},
caption,
caption
};

var idUser = new Store.WidFactory.createWid(chatid);
Expand Down
4 changes: 2 additions & 2 deletions src/lib/wapi/functions/send-link-preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export async function sendLinkPreview(chatId, url, text) {
_Path.End,
'i'
);
},
}
};
if (!_Path.Reg().test(url)) {
var text =
Expand Down Expand Up @@ -107,7 +107,7 @@ export async function sendLinkPreview(chatId, url, text) {
matchedText: linkPreview.matchedText,
preview: linkPreview.preview,
thumbnail: linkPreview.thumbnail,
title: linkPreview.title,
title: linkPreview.title
};
var result = (
await Promise.all(window.Store.addAndSendMsgToChat(chat, message))
Expand Down
4 changes: 2 additions & 2 deletions src/lib/wapi/functions/send-location.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export async function sendLocation(
type: 'location',
lat: latitude,
lng: longitude,
loc: location,
loc: location
};

const result =
Expand All @@ -92,7 +92,7 @@ export async function sendLocation(
latitude: latitude,
longitude: longitude,
title: location,
type: 'location',
type: 'location'
},
obj;
if (result == 'success' || result == 'OK') {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/wapi/functions/send-message-with-tags.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export async function sendMessageWithTags(to, body) {
type: 'chat',
body,
quotedMsg: null,
mentionedJidList,
mentionedJidList
};

Object.assign(tempMsg, extend);
Expand Down
4 changes: 2 additions & 2 deletions src/lib/wapi/functions/send-message-with-thumb.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,13 @@ export function sendMessageWithThumb(
description: description,
matchedText: url,
title: title,
thumbnail: thumb,
thumbnail: thumb
};
chatSend.sendMessage(url, {
linkPreview: linkPreview,
mentionedJidList: [],
quotedMsg: null,
quotedMsgAdminGroupJid: null,
quotedMsgAdminGroupJid: null
});
if (done !== undefined) done(true);
return true;
Expand Down
2 changes: 1 addition & 1 deletion src/lib/wapi/functions/send-message.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export async function sendMessage(to, content) {
t: parseInt(new Date().getTime() / 1000),
isNewMsg: !0,
invis: true,
type: 'chat',
type: 'chat'
};
var result = (
await Promise.all(window.Store.addAndSendMsgToChat(chat, message))
Expand Down
2 changes: 1 addition & 1 deletion src/lib/wapi/functions/send-sticker.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export async function sendSticker(sticker, chatId, metadata, type) {
var result =
(await stick.sendToChat(chat, {
stickerIsFirstParty: false,
stickerSendOrigin: 6,
stickerSendOrigin: 6
})) || '';
var m = { type: type },
obj,
Expand Down
8 changes: 4 additions & 4 deletions src/lib/wapi/listeners/add-on-participants-change.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export function addOnParticipantsChange() {
'remove',
'leave',
'promote',
'demote',
'demote'
];
const chat = window.Store.Chat.get(groupId);
//attach all group Participants to the events object as 'add'
Expand All @@ -82,7 +82,7 @@ export function addOnParticipantsChange() {
metadata.participants.forEach((participant) => {
groupParticpiantsEvents[groupId][participant.id.toString()] = {
subtype: 'add',
from: metadata.owner,
from: metadata.owner
};
});
}
Expand Down Expand Up @@ -113,7 +113,7 @@ export function addOnParticipantsChange() {
} else {
groupParticpiantsEvents[groupId][rec] = {
subtype,
from,
from
};
//fire the callback
// // previewMessage.from.toString()
Expand All @@ -122,7 +122,7 @@ export function addOnParticipantsChange() {
callback({
by: from.toString(),
action: subtype,
who: recipients,
who: recipients
});
chat.off('all', this);
i = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/lib/wapi/serializers/serialize-message.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,6 @@ export const _serializeMessageObj = (obj) => {
lastSeen: _chat.lastSeen,
quotedMsgObj: WAPI._serializeMessageObj(obj['_quotedMsgObj']),
mediaData: window.WAPI._serializeRawObj(obj['mediaData']),
reply: (body) => window.WAPI.reply(_chat.id._serialized, body, obj),
reply: (body) => window.WAPI.reply(_chat.id._serialized, body, obj)
});
};
2 changes: 1 addition & 1 deletion src/lib/wapi/serializers/serialize-number-status.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export const _serializeNumberStatusObj = (obj) => {
id: obj.jid,
status: obj.status,
isBusiness: obj.biz === true,
canReceiveMessage: obj.status === 200,
canReceiveMessage: obj.status === 200
}
);
};
2 changes: 1 addition & 1 deletion src/lib/wapi/serializers/serialize-profile-pic-thumb.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export const _serializeProfilePicThumb = (obj) => {
img: obj.img,
imgFull: obj.imgFull,
raw: obj.raw,
tag: obj.tag,
tag: obj.tag
}
);
};

0 comments on commit 81568ed

Please sign in to comment.