Skip to content

Commit 6692262

Browse files
committed
addressbook: detect contact folder items via server flag
Contact folder items (from personal and shared folders) lack the Contact Provider GUID in their entry ID, so the existing detection in isPersonalContact() and isPersonalDistList() missed them. This caused contacts and distribution lists from contact folders to be unrecognizable and unopenable from the addressbook dialog. Add an is_contact_item flag to the server response for all contact folder items and check it in both detection methods as a fallback when the entry ID has no Contact Provider GUID.
1 parent 3b0576d commit 6692262

2 files changed

Lines changed: 22 additions & 4 deletions

File tree

client/zarafa/addressbook/AddressBookRecord.js

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ Zarafa.addressbook.AddressBookRecordFields = [
5656
{name: 'comment'},
5757
{name: 'icon_index'},
5858
{name: 'is_shared'},
59+
{name: 'is_contact_item'},
5960
];
6061

6162
Zarafa.core.data.RecordFactory.addFieldToObjectType(Zarafa.core.mapi.ObjectType.MAPI_MAILUSER, Zarafa.addressbook.AddressBookRecordFields);
@@ -205,8 +206,16 @@ Zarafa.addressbook.AddressBookRecord = Ext.extend(Zarafa.core.data.MAPIRecord, {
205206
{
206207
if(Zarafa.core.MessageClass.isClass(this.get('message_class'), 'IPM.CONTACT', true)){
207208
return true;
208-
}else if (this.get('object_type') == Zarafa.core.mapi.ObjectType.MAPI_MAILUSER && Zarafa.core.EntryId.hasContactProviderGUID(this.get('entryid'))){
209-
return true;
209+
}
210+
if (this.get('object_type') == Zarafa.core.mapi.ObjectType.MAPI_MAILUSER) {
211+
if (Zarafa.core.EntryId.hasContactProviderGUID(this.get('entryid'))) {
212+
return true;
213+
}
214+
// Contact folder items have the is_contact_item flag set
215+
// by the server (both personal and shared contact folders).
216+
if (this.get('is_contact_item')) {
217+
return true;
218+
}
210219
}
211220
return false;
212221
},
@@ -222,8 +231,16 @@ Zarafa.addressbook.AddressBookRecord = Ext.extend(Zarafa.core.data.MAPIRecord, {
222231
{
223232
if(Zarafa.core.MessageClass.isClass(this.get('message_class'), 'IPM.DISTLIST', true)){
224233
return true;
225-
}else if (this.get('object_type') == Zarafa.core.mapi.ObjectType.MAPI_DISTLIST && Zarafa.core.EntryId.hasContactProviderGUID(this.get('entryid'))){
226-
return true;
234+
}
235+
if (this.get('object_type') == Zarafa.core.mapi.ObjectType.MAPI_DISTLIST) {
236+
if (Zarafa.core.EntryId.hasContactProviderGUID(this.get('entryid'))) {
237+
return true;
238+
}
239+
// Contact folder items have the is_contact_item flag set
240+
// by the server (both personal and shared contact folders).
241+
if (this.get('is_contact_item')) {
242+
return true;
243+
}
227244
}
228245
return false;
229246
},

server/includes/modules/class.addressbooklistmodule.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ public function GABUsers($action, $actionType) {
194194
// These are real contact items from a MAPI folder, not
195195
// AB entries, so they use contact properties instead of
196196
// AB list properties.
197+
$item['is_contact_item'] = true;
197198

198199
// Do not display private items from shared folders
199200
if ($isSharedFolder && isset($user_data[$this->properties['private']]) && $user_data[$this->properties['private']] === true) {

0 commit comments

Comments
 (0)