Fix contact status in createContactSyncProtoMessage

pull/609/head
sachaaaaa 6 years ago
parent 5529deb019
commit 843c5b5ebc

@ -120,13 +120,14 @@
{ ConversationCollection: Whisper.ConversationCollection } { ConversationCollection: Whisper.ConversationCollection }
); );
// Extract required contacts information out of conversations // Extract required contacts information out of conversations
const rawContacts = conversations.map(conversation => { const rawContacts = await Promise.all(
conversations.map(async conversation => {
const profile = conversation.getLokiProfile(); const profile = conversation.getLokiProfile();
const number = conversation.getNumber(); const number = conversation.getNumber();
const name = profile const name = profile
? profile.displayName ? profile.displayName
: conversation.getProfileName(); : conversation.getProfileName();
const status = conversation.safeGetVerified(); const status = await conversation.safeGetVerified();
const protoState = textsecure.storage.protocol.convertVerifiedStatusToProtoState( const protoState = textsecure.storage.protocol.convertVerifiedStatusToProtoState(
status status
); );
@ -143,7 +144,8 @@
blocked: conversation.isBlocked(), blocked: conversation.isBlocked(),
expireTimer: conversation.get('expireTimer'), expireTimer: conversation.get('expireTimer'),
}; };
}); })
);
// Convert raw contacts to an array of buffers // Convert raw contacts to an array of buffers
const contactDetails = rawContacts const contactDetails = rawContacts
.filter(x => x.number !== textsecure.storage.user.getNumber()) .filter(x => x.number !== textsecure.storage.user.getNumber())

Loading…
Cancel
Save