feat(mail(js)): new button to expand recipients that are LDAP groups

This commit is contained in:
Francis Lachapelle
2019-11-21 21:51:27 -05:00
parent f140bba03a
commit 456a66b66b
8 changed files with 81 additions and 22 deletions
@@ -329,6 +329,16 @@
});
}
}
else if (contact.$isGroup({expandable: true})) {
recipient = {
toString: function () { return contact.$shortFormat(); },
isExpandable: true,
members: []
};
contact.$members().then(function (members) {
recipient.members = members;
});
}
else {
recipient = contact.$shortFormat();
}
@@ -339,6 +349,16 @@
return null;
}
this.expandGroup = function(contact, field) {
var recipients, i, j;
recipients = vm.message.editable[field];
i = recipients.indexOf(contact);
recipients.splice(i, 1);
for (j = 0; j < contact.members.length; j++) {
recipients.splice(i + j, 0, contact.members[j].$shortFormat());
}
};
// Drafts autosaving
function autosaveDrafts() {
vm.message.$save();