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
);
// 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;
},
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);
confirm();
},

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

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

Loading…
Cancel
Save