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')
|
return ConversationController.getOrCreateAndWait(id, 'private')
|
||||||
.then(function(conversation) {
|
.then(function(conversation) {
|
||||||
return new Promise(function(resolve, reject) {
|
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) {
|
if (details.profileKey) {
|
||||||
conversation.set({profileKey: details.profileKey});
|
conversation.set({profileKey: details.profileKey});
|
||||||
}
|
}
|
||||||
|
@ -374,7 +382,7 @@
|
||||||
name: details.name,
|
name: details.name,
|
||||||
avatar: details.avatar,
|
avatar: details.avatar,
|
||||||
color: details.color,
|
color: details.color,
|
||||||
active_at: conversation.get('active_at') || Date.now(),
|
active_at: activeAt,
|
||||||
}).then(resolve, reject);
|
}).then(resolve, reject);
|
||||||
}).then(function() {
|
}).then(function() {
|
||||||
if (details.verified) {
|
if (details.verified) {
|
||||||
|
@ -411,7 +419,13 @@
|
||||||
type: 'group',
|
type: 'group',
|
||||||
};
|
};
|
||||||
if (details.active) {
|
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 {
|
} else {
|
||||||
updates.left = true;
|
updates.left = true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue