From 09d688c00a58854d5f0eb066f752feea061e135e Mon Sep 17 00:00:00 2001 From: Lyubomir Marinov Date: Fri, 7 Jan 2011 20:07:54 +0000 Subject: Displays kABOrganizationProperty as the displayName of SourceContact for companies fetched from the Address Book of Mac OS X. --- ...in_addrbook_macosx_MacOSXAddrBookContactQuery.h | 16 +++++++++++++++ ...in_addrbook_macosx_MacOSXAddrBookContactQuery.m | 24 ++++++++++++++++++++++ 2 files changed, 40 insertions(+) (limited to 'src/native/addrbook/macosx') diff --git a/src/native/addrbook/macosx/net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery.h b/src/native/addrbook/macosx/net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery.h index c4d410e..695b64d 100644 --- a/src/native/addrbook/macosx/net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery.h +++ b/src/native/addrbook/macosx/net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery.h @@ -121,6 +121,22 @@ JNIEXPORT jlong JNICALL Java_net_java_sip_communicator_plugin_addrbook_macosx_Ma /* * Class: net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery + * Method: kABOrganizationProperty + * Signature: ()J + */ +JNIEXPORT jlong JNICALL Java_net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery_kABOrganizationProperty + (JNIEnv *, jclass); + +/* + * Class: net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery + * Method: kABPersonFlags + * Signature: ()J + */ +JNIEXPORT jlong JNICALL Java_net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery_kABPersonFlags + (JNIEnv *, jclass); + +/* + * Class: net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery * Method: kABPhoneProperty * Signature: ()J */ 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 23a2e50..f21aabe 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 @@ -121,6 +121,8 @@ DEFINE_ABPERSON_PROPERTY_GETTER(kABMiddleNameProperty) DEFINE_ABPERSON_PROPERTY_GETTER(kABMiddleNamePhoneticProperty) DEFINE_ABPERSON_PROPERTY_GETTER(kABMSNInstantProperty) DEFINE_ABPERSON_PROPERTY_GETTER(kABNicknameProperty) +DEFINE_ABPERSON_PROPERTY_GETTER(kABOrganizationProperty) +DEFINE_ABPERSON_PROPERTY_GETTER(kABPersonFlags) DEFINE_ABPERSON_PROPERTY_GETTER(kABPhoneProperty) DEFINE_ABPERSON_PROPERTY_GETTER(kABYahooInstantProperty) @@ -166,6 +168,28 @@ MacOSXAddrBookContactQuery_idToJObject } } } + else if ([o isKindOfClass:[NSNumber class]]) + { + jclass longClass = (*jniEnv)->FindClass(jniEnv, "java/lang/Long"); + + jo = NULL; + if (longClass) + { + jmethodID longMethodID + = (*jniEnv)->GetMethodID( + jniEnv, + longClass, "", "(J)V"); + + if (longMethodID) + { + jo + = (*jniEnv)->NewObject( + jniEnv, + longClass, longMethodID, + (jlong) ([((NSNumber *) o) longValue])); + } + } + } else jo = NULL; if (jo) -- cgit v1.1