diff --git a/js/background.js b/js/background.js index 338c82ca8..42475c038 100644 --- a/js/background.js +++ b/js/background.js @@ -1816,12 +1816,21 @@ await conversation.setSecondaryStatus(true, ourPrimaryKey); } - if (conversation.isFriendRequestStatusNoneOrExpired()) { - libloki.api.sendAutoFriendRequestMessage(conversation.id); - } else { - // Accept any pending friend requests if there are any - conversation.onAcceptFriendRequest({ blockSync: true }); - } + const otherDevices = await libloki.storage.getPairedDevicesFor(id); + const devices = [id, ...otherDevices]; + const deviceConversations = await Promise.all(devices.map(d => ConversationController.getOrCreateAndWait( + d, + 'private' + ))); + deviceConversations.forEach(device => { + if (device.isFriendRequestStatusNoneOrExpired()) { + libloki.api.sendAutoFriendRequestMessage(device.id); + } else { + // Accept any pending friend requests if there are any + device.onAcceptFriendRequest({ blockSync: true }); + } + }); + if (details.profileKey) { const profileKey = window.Signal.Crypto.arrayBufferToBase64(