|
|
|
@ -60,6 +60,7 @@
|
|
|
|
|
this.onSubmit = this.onSubmit.bind(this);
|
|
|
|
|
this.isPublic = groupConvo.isPublic();
|
|
|
|
|
this.groupId = groupConvo.id;
|
|
|
|
|
this.members = groupConvo.get('members') || [];
|
|
|
|
|
|
|
|
|
|
const ourPK = textsecure.storage.user.getNumber();
|
|
|
|
|
|
|
|
|
@ -76,27 +77,6 @@
|
|
|
|
|
this.isAdmin = groupConvo.isModerator(
|
|
|
|
|
window.storage.get('primaryDevicePubKey')
|
|
|
|
|
);
|
|
|
|
|
// zero out friendList for now
|
|
|
|
|
this.friendsAndMembers = [];
|
|
|
|
|
this.existingMembers = [];
|
|
|
|
|
} else {
|
|
|
|
|
const convos = window.getConversations().models.filter(d => !!d);
|
|
|
|
|
|
|
|
|
|
this.existingMembers = groupConvo.get('members') || [];
|
|
|
|
|
// Show a contact if they are our friend or if they are a member
|
|
|
|
|
this.friendsAndMembers = convos.filter(
|
|
|
|
|
d => this.existingMembers.includes(d.id) && d.isPrivate() && !d.isMe()
|
|
|
|
|
);
|
|
|
|
|
this.friendsAndMembers = _.uniq(
|
|
|
|
|
this.friendsAndMembers,
|
|
|
|
|
true,
|
|
|
|
|
d => d.id
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
// at least make sure it's an array
|
|
|
|
|
if (!Array.isArray(this.existingMembers)) {
|
|
|
|
|
this.existingMembers = [];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.$el.focus();
|
|
|
|
@ -140,7 +120,6 @@
|
|
|
|
|
this.isPublic = groupConvo.isPublic();
|
|
|
|
|
this.groupId = groupConvo.id;
|
|
|
|
|
this.avatarPath = groupConvo.getAvatarPath();
|
|
|
|
|
this.members = groupConvo.get('members') || [];
|
|
|
|
|
|
|
|
|
|
if (this.isPublic) {
|
|
|
|
|
this.titleText = `${i18n('updatePublicGroupDialogTitle')}: ${
|
|
|
|
@ -151,9 +130,29 @@
|
|
|
|
|
this.isAdmin = groupConvo.isModerator(
|
|
|
|
|
window.storage.get('primaryDevicePubKey')
|
|
|
|
|
);
|
|
|
|
|
// zero out friendList for now
|
|
|
|
|
this.friendsAndMembers = [];
|
|
|
|
|
this.existingMembers = [];
|
|
|
|
|
} else {
|
|
|
|
|
this.titleText = i18n('updateGroupDialogTitle');
|
|
|
|
|
this.isAdmin = groupConvo.get('groupAdmins').includes(ourPK);
|
|
|
|
|
const convos = window.getConversations().models.filter(d => !!d);
|
|
|
|
|
|
|
|
|
|
this.existingMembers = groupConvo.get('members') || [];
|
|
|
|
|
// Show a contact if they are our friend or if they are a member
|
|
|
|
|
this.friendsAndMembers = convos.filter(
|
|
|
|
|
d => this.existingMembers.includes(d.id) && d.isPrivate() && !d.isMe()
|
|
|
|
|
);
|
|
|
|
|
this.friendsAndMembers = _.uniq(
|
|
|
|
|
this.friendsAndMembers,
|
|
|
|
|
true,
|
|
|
|
|
d => d.id
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
// at least make sure it's an array
|
|
|
|
|
if (!Array.isArray(this.existingMembers)) {
|
|
|
|
|
this.existingMembers = [];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.$el.focus();
|
|
|
|
|