On group/contact import: don't re-add hidden entries to left pane (#1811)
* On contact import: don't re-add hidden contacts to left pane * On group import: don't re-add hidden groups to left pane
This commit is contained in:
parent
93a34e5699
commit
b8b26d3e79
1 changed files with 16 additions and 2 deletions
|
@ -367,6 +367,14 @@
|
|||
return ConversationController.getOrCreateAndWait(id, 'private')
|
||||
.then(function(conversation) {
|
||||
return new Promise(function(resolve, reject) {
|
||||
var activeAt = conversation.get('active_at');
|
||||
|
||||
// The idea is to make any new contact show up in the left pane. If
|
||||
// activeAt is null, then this contact has been purposefully hidden.
|
||||
if (activeAt !== null) {
|
||||
activeAt = activeAt || Date.now();
|
||||
}
|
||||
|
||||
if (details.profileKey) {
|
||||
conversation.set({profileKey: details.profileKey});
|
||||
}
|
||||
|
@ -374,7 +382,7 @@
|
|||
name: details.name,
|
||||
avatar: details.avatar,
|
||||
color: details.color,
|
||||
active_at: conversation.get('active_at') || Date.now(),
|
||||
active_at: activeAt,
|
||||
}).then(resolve, reject);
|
||||
}).then(function() {
|
||||
if (details.verified) {
|
||||
|
@ -411,7 +419,13 @@
|
|||
type: 'group',
|
||||
};
|
||||
if (details.active) {
|
||||
updates.active_at = Date.now();
|
||||
var activeAt = conversation.get('active_at');
|
||||
|
||||
// The idea is to make any new group show up in the left pane. If
|
||||
// activeAt is null, then this group has been purposefully hidden.
|
||||
if (activeAt !== null) {
|
||||
updates.active_at = activeAt || Date.now();
|
||||
}
|
||||
} else {
|
||||
updates.left = true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue