Skip to content

Commit 278bcd5

Browse files
committed
addressbook: check distlist type before contact on open
Shared distribution lists have the is_shared flag set, so isSharedContact() matched them before isPersonalDistList() had a chance to run. This caused shared distlists to be converted to contact records and opened with the wrong dialog. Move the isPersonalDistList() check ahead of the contact checks so distribution lists are always handled correctly regardless of their shared status.
1 parent 6692262 commit 278bcd5

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

client/zarafa/addressbook/Actions.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,18 @@ Zarafa.addressbook.Actions = {
3232
if (Array.isArray(records) && !Ext.isEmpty(records)) {
3333
records = records[0];
3434
}
35-
if (records.isPersonalContact() || records.isSharedContact()) {
36-
// A personal contact needs to be converted to a contact so the correct panel can be shown.
37-
records = records.convertToContactRecord();
35+
if (records.isPersonalDistList()) {
36+
// A personal distlist needs to be converted to a distlist so the correct panel can be shown.
37+
// This must be checked before isSharedContact() because shared distlists also
38+
// have is_shared set and would incorrectly be opened as contacts.
39+
records = records.convertToDistListRecord();
3840
// FIXME: We put the abRecord into the ShadowStore to be able
3941
// to open it, and obtain all details. However, we also need to
4042
// find a point where we can remove it again.
4143
container.getShadowStore().add(records);
42-
} else if (records.isPersonalDistList()) {
43-
// A personal distlist needs to be converted to a distlist so the correct panel can be shown.
44-
records = records.convertToDistListRecord();
44+
} else if (records.isPersonalContact() || records.isSharedContact()) {
45+
// A personal contact needs to be converted to a contact so the correct panel can be shown.
46+
records = records.convertToContactRecord();
4547
// FIXME: We put the abRecord into the ShadowStore to be able
4648
// to open it, and obtain all details. However, we also need to
4749
// find a point where we can remove it again.

0 commit comments

Comments
 (0)