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

@ -262,7 +262,7 @@
messages.forEach(m => { messages.forEach(m => {
m.acceptFriendRequest(); m.acceptFriendRequest();
lastMessage = m; lastMessage = m;
}) });
if (lastMessage) { if (lastMessage) {
await this.markRead(); await this.markRead();

@ -665,13 +665,14 @@ MessageSender.prototype = {
return Promise.resolve(); return Promise.resolve();
} }
// first get all friends with primary devices // first get all friends with primary devices
const sessionContactsPrimary = conversations.filter( const sessionContactsPrimary =
c => conversations.filter(
c.isPrivate() && c =>
!c.isOurLocalDevice() && c.isPrivate() &&
c.isFriend() && !c.isOurLocalDevice() &&
!c.get('secondaryStatus') c.isFriend() &&
) || []; !c.get('secondaryStatus')
) || [];
// then get all friends with secondary devices // then get all friends with secondary devices
let sessionContactsSecondary = conversations.filter( let sessionContactsSecondary = conversations.filter(
@ -683,14 +684,21 @@ MessageSender.prototype = {
); );
// then morph all secondary conversation to their primary // then morph all secondary conversation to their primary
sessionContactsSecondary = await Promise.all(sessionContactsSecondary.map(async c => { sessionContactsSecondary =
return window.ConversationController.getOrCreateAndWait( (await Promise.all(
c.getPrimaryDevicePubKey(), // eslint-disable-next-line arrow-body-style
'private' sessionContactsSecondary.map(async c => {
); return window.ConversationController.getOrCreateAndWait(
})) || []; c.getPrimaryDevicePubKey(),
'private'
);
})
)) || [];
const contactsSet = new Set([...sessionContactsPrimary, ...sessionContactsSecondary]); const contactsSet = new Set([
...sessionContactsPrimary,
...sessionContactsSecondary,
]);
const contacts = [...contactsSet]; const contacts = [...contactsSet];
if (contacts.length === 0) { if (contacts.length === 0) {

Loading…
Cancel
Save