From 8512c2307beca5b06b8e6469189c57acf973395f Mon Sep 17 00:00:00 2001 From: Mikunj Date: Fri, 29 May 2020 15:16:14 +1000 Subject: [PATCH] Linting --- js/models/messages.js | 24 +++++++++++++++--------- libtextsecure/outgoing_message.js | 18 ++++-------------- 2 files changed, 19 insertions(+), 23 deletions(-) diff --git a/js/models/messages.js b/js/models/messages.js index dc62e6846..ee668df59 100644 --- a/js/models/messages.js +++ b/js/models/messages.js @@ -420,14 +420,16 @@ } const devicePubKey = this.get('conversationId'); - const otherDevices = await libloki.storage.getPairedDevicesFor(devicePubKey); + const otherDevices = await libloki.storage.getPairedDevicesFor( + devicePubKey + ); const allDevices = [devicePubKey, ...otherDevices]; // Set profile name to primary conversation let profileName; - const allConversationsWithUser = allDevices.map(d => - ConversationController.get(d) - ).filter(c => Boolean(c)); + const allConversationsWithUser = allDevices + .map(d => ConversationController.get(d)) + .filter(c => Boolean(c)); allConversationsWithUser.forEach(conversation => { // If we somehow received an old friend request (e.g. after having restored // from seed, we won't be able to accept it, we should initiate our own @@ -445,7 +447,9 @@ // If you don't have a profile name for this device, and profileName is set, // add profileName to conversation. - const primaryDevicePubKey = (await libloki.storage.getPrimaryDeviceFor(devicePubKey)) || devicePubKey; + const primaryDevicePubKey = + (await libloki.storage.getPrimaryDeviceFor(devicePubKey)) || + devicePubKey; const primaryConversation = allConversationsWithUser.find( c => c.id === primaryDevicePubKey ); @@ -477,11 +481,13 @@ }); const devicePubKey = this.attributes.conversationId; - const otherDevices = await libloki.storage.getPairedDevicesFor(devicePubKey); + const otherDevices = await libloki.storage.getPairedDevicesFor( + devicePubKey + ); const allDevices = [devicePubKey, ...otherDevices]; - const allConversationsWithUser = allDevices.map(d => - ConversationController.get(d) - ).filter(c => Boolean(c)); + const allConversationsWithUser = allDevices + .map(d => ConversationController.get(d)) + .filter(c => Boolean(c)); allConversationsWithUser.forEach(conversation => { conversation.onDeclineFriendRequest(); }); diff --git a/libtextsecure/outgoing_message.js b/libtextsecure/outgoing_message.js index c0485efed..f6fb0df55 100644 --- a/libtextsecure/outgoing_message.js +++ b/libtextsecure/outgoing_message.js @@ -215,11 +215,7 @@ OutgoingMessage.prototype = { this.errors[this.errors.length] = error; this.numberCompleted(); }, - reloadDevicesAndSend( - primaryPubKey, - multiDevice = true, - excludedDevices = [] - ) { + reloadDevicesAndSend(primaryPubKey, multiDevice = true) { const ourNumber = textsecure.storage.user.getNumber(); if (!multiDevice) { @@ -235,9 +231,7 @@ OutgoingMessage.prototype = { .getAllDevicePubKeysForPrimaryPubKey(primaryPubKey) // Don't send to ourselves .then(devicesPubKeys => - devicesPubKeys.filter( - pubKey => pubKey !== ourNumber && !excludedDevices.includes(pubKey) - ) + devicesPubKeys.filter(pubKey => pubKey !== ourNumber) ) .then(devicesPubKeys => { if (devicesPubKeys.length === 0) { @@ -706,18 +700,14 @@ OutgoingMessage.prototype = { return promise; }, - sendToNumber(number, multiDevice = true, excludedDevices = []) { + sendToNumber(number, multiDevice = true) { let conversation; try { conversation = ConversationController.get(number); } catch (e) { // do nothing } - return this.reloadDevicesAndSend( - number, - multiDevice, - excludedDevices - ).catch(error => { + return this.reloadDevicesAndSend(number, multiDevice).catch(error => { conversation.resetPendingSend(); if (error.message === 'Identity key changed') { // eslint-disable-next-line no-param-reassign