diff --git a/libtextsecure/account_manager.js b/libtextsecure/account_manager.js index 0ee00d76a..8452e3934 100644 --- a/libtextsecure/account_manager.js +++ b/libtextsecure/account_manager.js @@ -596,7 +596,7 @@ // throws if invalid this.validatePubKeyHex(secondaryDevicePubKey); // we need a conversation for sending a message - await ConversationController.getOrCreateAndWait( + const secondaryConversation = await ConversationController.getOrCreateAndWait( secondaryDevicePubKey, 'private' ); @@ -626,6 +626,13 @@ authorisation, secondaryDevicePubKey ); + // Always be friends with secondary devices + await secondaryConversation.setFriendRequestStatus( + window.friends.friendRequestStatusEnum.friends, + { + blockSync: true, + } + ); }, validatePubKeyHex(pubKey) { const c = new Whisper.Conversation({ diff --git a/libtextsecure/message_receiver.js b/libtextsecure/message_receiver.js index 3a6ca8e69..70422f6c7 100644 --- a/libtextsecure/message_receiver.js +++ b/libtextsecure/message_receiver.js @@ -1465,7 +1465,7 @@ MessageReceiver.prototype.extend({ const ourNumber = textsecure.storage.user.getNumber(); // NOTE: Maybe we should be caching this list? const ourAuthorisations = await libloki.storage.getPrimaryDeviceMapping( - ourNumber + window.storage.get('primaryDevicePubKey') ); const validSyncSender = ourAuthorisations &&