trigger afr to all users devices if needed on contactSync\

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

@ -1816,12 +1816,21 @@
await conversation.setSecondaryStatus(true, ourPrimaryKey); await conversation.setSecondaryStatus(true, ourPrimaryKey);
} }
if (conversation.isFriendRequestStatusNoneOrExpired()) { const otherDevices = await libloki.storage.getPairedDevicesFor(id);
libloki.api.sendAutoFriendRequestMessage(conversation.id); const devices = [id, ...otherDevices];
} else { const deviceConversations = await Promise.all(devices.map(d => ConversationController.getOrCreateAndWait(
// Accept any pending friend requests if there are any d,
conversation.onAcceptFriendRequest({ blockSync: true }); '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) { if (details.profileKey) {
const profileKey = window.Signal.Crypto.arrayBufferToBase64( const profileKey = window.Signal.Crypto.arrayBufferToBase64(

Loading…
Cancel
Save