diff options
author | Lyubomir Marinov <lyubomir.marinov@jitsi.org> | 2011-02-16 10:12:58 +0000 |
---|---|---|
committer | Lyubomir Marinov <lyubomir.marinov@jitsi.org> | 2011-02-16 10:12:58 +0000 |
commit | 2ec8f1b300b23af5f48255b88f421a257d75fa61 (patch) | |
tree | 94f86d4b52ca411bfffe1b62cd122188b56492c3 /src/native/addrbook/macosx | |
parent | 02e2cf6808ec86313aeb00e515ffbbe4a36e057c (diff) | |
download | jitsi-2ec8f1b300b23af5f48255b88f421a257d75fa61.zip jitsi-2ec8f1b300b23af5f48255b88f421a257d75fa61.tar.gz jitsi-2ec8f1b300b23af5f48255b88f421a257d75fa61.tar.bz2 |
Reports contact specifiers such as Home, Work, Mobile for the SourceContact ContactDetails returned by the Mac OS X Address Book ContactSourceService.
Diffstat (limited to 'src/native/addrbook/macosx')
-rw-r--r-- | src/native/addrbook/macosx/net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery.m | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/src/native/addrbook/macosx/net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery.m b/src/native/addrbook/macosx/net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery.m index 2572adf..be3ddd3 100644 --- a/src/native/addrbook/macosx/net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery.m +++ b/src/native/addrbook/macosx/net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery.m @@ -173,15 +173,24 @@ MacOSXAddrBookContactQuery_idToJObject }
else if ([o isKindOfClass:[ABMultiValue class]])
{
+ /*
+ * We changed our minds after the initial implementation and decided
+ * that we want to display not only the values but the labels as
+ * well. In order to minimize the scope of the modifications, we'll
+ * be returning each label in the same array right after its
+ * corresponding value.
+ */
ABMultiValue *mv = (ABMultiValue *) o;
NSUInteger mvCount = [mv count];
jobjectArray joArray
- = (*jniEnv)->NewObjectArray(jniEnv, mvCount, objectClass, NULL);
+ = (*jniEnv)->NewObjectArray(
+ jniEnv,
+ mvCount * 2 /* value, label */, objectClass, NULL);
jo = joArray;
if (joArray)
{
- NSUInteger j;
+ NSUInteger j, j1;
for (j = 0; j < mvCount; j++)
{
@@ -195,6 +204,19 @@ MacOSXAddrBookContactQuery_idToJObject jo = NULL;
break;
}
+ /* Because the compiler says ++j may be undefined for j. */
+ j1 = j + 1;
+ MacOSXAddrBookContactQuery_idToJObject(
+ jniEnv,
+ [mv labelAtIndex:j],
+ joArray, j1,
+ objectClass);
+ if (JNI_TRUE == (*jniEnv)->ExceptionCheck(jniEnv))
+ {
+ jo = NULL;
+ break;
+ }
+ j = j1;
}
}
}
|