diff options
author | Vincent Lucas <chenzo@jitsi.org> | 2013-04-08 23:21:41 +0000 |
---|---|---|
committer | Vincent Lucas <chenzo@jitsi.org> | 2013-04-08 23:21:41 +0000 |
commit | cf6543e01ab31b1316c37881bd46a99fbf7ca156 (patch) | |
tree | 8e5dde63d5e5508b26edc2347a4b92b72a27f4e5 /src/native/addrbook/AddrBookContactQuery.c | |
parent | fc26a933f9ec7096fa93ffbbc76230de2ffce3a0 (diff) | |
download | jitsi-cf6543e01ab31b1316c37881bd46a99fbf7ca156.zip jitsi-cf6543e01ab31b1316c37881bd46a99fbf7ca156.tar.gz jitsi-cf6543e01ab31b1316c37881bd46a99fbf7ca156.tar.bz2 |
Corrects IMAPIProp_GetProps problem with outlook. Adds contact addition and deletion functionality for outlook and MacOsX contacts. Improves and corrects getting and setting contact details for outlook and MacOsX contacts.
Diffstat (limited to 'src/native/addrbook/AddrBookContactQuery.c')
-rw-r--r-- | src/native/addrbook/AddrBookContactQuery.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/native/addrbook/AddrBookContactQuery.c b/src/native/addrbook/AddrBookContactQuery.c index 1045214..415ce67 100644 --- a/src/native/addrbook/AddrBookContactQuery.c +++ b/src/native/addrbook/AddrBookContactQuery.c @@ -44,6 +44,41 @@ AddrBookContactQuery_getPtrCallbackMethodID(JNIEnv *jniEnv, jobject callback) return callbackMethodID; } +jmethodID +AddrBookContactQuery_getStringCallbackMethodID( + JNIEnv *jniEnv, jobject callback) +{ + jclass callbackClass; + jmethodID callbackMethodID = 0; + + /* + * Make sure that the specified arguments are valid. For example, check + * whether callback exists and has the necessary signature. + */ + if (callback) + { + callbackClass = (*jniEnv)->GetObjectClass(jniEnv, callback); + if (callbackClass) + { + callbackMethodID + = (*jniEnv)->GetMethodID( + jniEnv, + callbackClass, "callback", "(Ljava/lang/String;)Z"); + if (!callbackMethodID) + { + Exception_throwNew( + jniEnv, "java/lang/IllegalArgumentException", "callback"); + } + } + } + else + { + Exception_throwNew( + jniEnv, "java/lang/NullPointerException", "callback"); + } + return callbackMethodID; +} + static void Exception_throwNew(JNIEnv *jniEnv, const char *className, const char *message) { |