diff --git a/src/net/java/sip/communicator/plugin/addrbook/macosx/MacOSXAddrBookContactQuery.java b/src/net/java/sip/communicator/plugin/addrbook/macosx/MacOSXAddrBookContactQuery.java
index ebf1f039c..cfd51b49e 100644
--- a/src/net/java/sip/communicator/plugin/addrbook/macosx/MacOSXAddrBookContactQuery.java
+++ b/src/net/java/sip/communicator/plugin/addrbook/macosx/MacOSXAddrBookContactQuery.java
@@ -689,7 +689,7 @@ else if (subValue instanceof Object[])
* @return the displayName to be set on a SourceContact
* which is to represent the ABPerson specified by values
*/
- static String getDisplayName(Object[] values)
+ private static String getDisplayName(Object[] values)
{
long personFlags
= (values[kABPersonFlags] instanceof Long)
@@ -792,6 +792,32 @@ else if (value instanceof Object[])
return displayName;
}
+ /**
+ * Gets the organization name to be set on a SourceContact.
+ *
+ * @param values the values of the ABPERSON_PROPERTIES which
+ * represent the ABPerson to get the organization name of.
+ *
+ * @return The organization name to be set on a SourceContact.
+ */
+ private static String getOrganization(Object[] values)
+ {
+ String organization = "";
+ long personFlags
+ = (values[kABPersonFlags] instanceof Long)
+ ? ((Long) values[kABPersonFlags]).longValue()
+ : 0;
+
+ if ((personFlags & kABShowAsMask) != kABShowAsCompany)
+ {
+ organization = (values[kABOrganizationProperty] instanceof String)
+ ? (String) values[kABOrganizationProperty]
+ : "";
+ }
+
+ return organization;
+ }
+
/**
* Gets the value of the kABAIMInstantProperty constant.
*
@@ -1108,6 +1134,7 @@ private boolean onPerson(long person)
displayName,
contactDetails);
sourceContact.setData(SourceContact.DATA_ID, id);
+ sourceContact.setDisplayDetails(getOrganization(values));
try
{
@@ -1247,6 +1274,7 @@ public void updated(long person)
= (MacOSXAddrBookSourceContact)sourceContact;
editableSourceContact.setDisplayName(displayName);
+ editableSourceContact.setDisplayDetails(getOrganization(values));
List contactDetails = getContactDetails(values, id);
editableSourceContact.setDetails(contactDetails);