use active_at to show and sync real contacts from contact list

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

@ -20,7 +20,7 @@
!d.isBlocked() && !d.isBlocked() &&
d.isPrivate() && d.isPrivate() &&
!d.isMe() && !d.isMe() &&
!!d.attributes.timestamp !!d.get('active_at')
); );
if (!convo.isPublic()) { if (!convo.isPublic()) {
const members = convo.get('members') || []; const members = convo.get('members') || [];

@ -334,6 +334,7 @@ async function onContactReceived(details: any) {
// activeAt is null, then this contact has been purposefully hidden. // activeAt is null, then this contact has been purposefully hidden.
if (activeAt !== null) { if (activeAt !== null) {
activeAt = activeAt || Date.now(); activeAt = activeAt || Date.now();
conversation.set('active_at', activeAt);
} }
const ourPrimaryKey = window.storage.get('primaryDevicePubKey'); const ourPrimaryKey = window.storage.get('primaryDevicePubKey');
if (ourPrimaryKey) { if (ourPrimaryKey) {
@ -375,7 +376,6 @@ async function onContactReceived(details: any) {
conversation.set({ conversation.set({
// name: details.name, // name: details.name,
color: details.color, color: details.color,
active_at: activeAt,
}); });
await conversation.setLokiProfile({ displayName: details.name }); await conversation.setLokiProfile({ displayName: details.name });
@ -427,6 +427,7 @@ async function onContactReceived(details: any) {
verifiedEvent.viaContactSync = true; verifiedEvent.viaContactSync = true;
await onVerified(verifiedEvent); await onVerified(verifiedEvent);
} }
await conversation.trigger('change');
} catch (error) { } catch (error) {
window.log.error('onContactReceived error:', Errors.toLogFormat(error)); window.log.error('onContactReceived error:', Errors.toLogFormat(error));
} }

@ -50,7 +50,8 @@ export async function getSyncContacts(): Promise<Array<any> | undefined> {
c.isPrivate() && c.isPrivate() &&
!c.isOurLocalDevice() && !c.isOurLocalDevice() &&
!c.isBlocked() && !c.isBlocked() &&
!c.attributes.secondaryStatus !c.attributes.secondaryStatus &&
!!c.get('active_at')
) || []; ) || [];
const secondaryContactsPartial = conversations.filter( const secondaryContactsPartial = conversations.filter(
@ -58,7 +59,8 @@ export async function getSyncContacts(): Promise<Array<any> | undefined> {
c.isPrivate() && c.isPrivate() &&
!c.isOurLocalDevice() && !c.isOurLocalDevice() &&
!c.isBlocked() && !c.isBlocked() &&
c.attributes.secondaryStatus c.attributes.secondaryStatus &&
!!c.get('active_at')
); );
const secondaryContactsPromise = secondaryContactsPartial.map(async c => const secondaryContactsPromise = secondaryContactsPartial.map(async c =>

@ -139,7 +139,7 @@ export const _getLeftPaneLists = (
// Remove all invalid conversations and conversatons of devices associated // Remove all invalid conversations and conversatons of devices associated
// with cancelled attempted links // with cancelled attempted links
if (!conversation.isPublic && !conversation.timestamp) { if (!conversation.isPublic && !conversation.activeAt) {
continue; continue;
} }
@ -151,10 +151,6 @@ export const _getLeftPaneLists = (
unreadCount += conversation.unreadCount; unreadCount += conversation.unreadCount;
} }
if (!conversation.isPublic && !conversation.activeAt) {
continue;
}
if (conversation.isArchived) { if (conversation.isArchived) {
archivedConversations.push(conversation); archivedConversations.push(conversation);
} else { } else {

Loading…
Cancel
Save