pull/1137/head
Audric Ackermann 5 years ago
parent d695c57805
commit 03757ba2ca
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4

@ -137,6 +137,10 @@ describe('Message Syncing', function() {
1 1
); );
// be sure only one autoFR accept was sent (even if multi device, we need to reply to that specific device only) // be sure only one autoFR accept was sent (even if multi device, we need to reply to that specific device only)
await common.logsContains(bob1Logs, `Sending auto-friend-accept:onlineBroadcast message to`, 1); await common.logsContains(
bob1Logs,
`Sending auto-friend-accept:onlineBroadcast message to`,
1
);
}); });
}); });

@ -2082,7 +2082,7 @@
return false; return false;
}, },
async handleSessionRequest(source, confirm) { async handleSessionRequest(source, confirm) {
window.console.log(`Received SESSION_REQUEST from source: ${source}`) window.console.log(`Received SESSION_REQUEST from source: ${source}`);
window.libloki.api.sendSessionEstablishedMessage(source); window.libloki.api.sendSessionEstablishedMessage(source);
confirm(); confirm();
}, },

@ -1,4 +1,4 @@
/* global log, libloki, process, window */ /* global log, libloki, window */
/* global storage: false */ /* global storage: false */
/* global Signal: false */ /* global Signal: false */
/* global log: false */ /* global log: false */

@ -6,7 +6,6 @@
libloki, libloki,
StringView, StringView,
lokiMessageAPI, lokiMessageAPI,
i18n,
log log
*/ */
@ -216,7 +215,11 @@ OutgoingMessage.prototype = {
this.errors[this.errors.length] = error; this.errors[this.errors.length] = error;
this.numberCompleted(); this.numberCompleted();
}, },
reloadDevicesAndSend(primaryPubKey, multiDevice = true, excludedDevices = []) { reloadDevicesAndSend(
primaryPubKey,
multiDevice = true,
excludedDevices = []
) {
const ourNumber = textsecure.storage.user.getNumber(); const ourNumber = textsecure.storage.user.getNumber();
if (!multiDevice) { if (!multiDevice) {
@ -232,10 +235,11 @@ OutgoingMessage.prototype = {
.getAllDevicePubKeysForPrimaryPubKey(primaryPubKey) .getAllDevicePubKeysForPrimaryPubKey(primaryPubKey)
// Don't send to ourselves // Don't send to ourselves
.then(devicesPubKeys => .then(devicesPubKeys =>
devicesPubKeys.filter(pubKey => pubKey !== ourNumber && !excludedDevices.includes(pubKey)) devicesPubKeys.filter(
pubKey => pubKey !== ourNumber && !excludedDevices.includes(pubKey)
)
) )
.then(devicesPubKeys => { .then(devicesPubKeys => {
if (devicesPubKeys.length === 0) { if (devicesPubKeys.length === 0) {
// No need to start the sending of message without a recipient // No need to start the sending of message without a recipient
return Promise.resolve(); return Promise.resolve();
@ -709,7 +713,11 @@ OutgoingMessage.prototype = {
} catch (e) { } catch (e) {
// do nothing // do nothing
} }
return this.reloadDevicesAndSend(number, multiDevice, excludedDevices).catch(error => { return this.reloadDevicesAndSend(
number,
multiDevice,
excludedDevices
).catch(error => {
conversation.resetPendingSend(); conversation.resetPendingSend();
if (error.message === 'Identity key changed') { if (error.message === 'Identity key changed') {
// eslint-disable-next-line no-param-reassign // eslint-disable-next-line no-param-reassign

Loading…
Cancel
Save