add missing get-contact-id function

This commit is contained in:
B. Petersen
2018-09-15 15:40:33 +02:00
parent c447e74b29
commit 2f91d956e6
2 changed files with 19 additions and 12 deletions
+7 -1
View File
@@ -18,7 +18,7 @@
* this program. If not, see http://www.gnu.org/licenses/ .
*
******************************************************************************/
// Purpose: The C part of the Java<->C Wrapper, see also DcContext.java
@@ -1186,6 +1186,12 @@ JNIEXPORT void Java_com_b44t_messenger_DcContact_unrefContactCPtr(JNIEnv *env, j
}
JNIEXPORT jint Java_com_b44t_messenger_DcContact_getId(JNIEnv *env, jobject obj)
{
return dc_contact_get_id(get_dc_contact(env, obj));
}
JNIEXPORT jstring Java_com_b44t_messenger_DcContact_getName(JNIEnv *env, jobject obj)
{
const char* temp = dc_contact_get_name(get_dc_contact(env, obj));
+12 -11
View File
@@ -25,8 +25,8 @@ package com.b44t.messenger;
public class DcContact {
public final static int DC_CONTACT_ID_SELF = 1;
public final static int DC_CONTACT_ID_DEVICE = 2;
public final static int DC_CONTACT_ID_SELF = 1;
public final static int DC_CONTACT_ID_DEVICE = 2;
public final static int DC_CONTACT_ID_LAST_SPECIAL = 9;
public DcContact(long contactCPtr) {
@@ -39,15 +39,16 @@ public class DcContact {
contactCPtr = 0;
}
public native String getName();
public native String getDisplayName();
public native String getFirstName();
public native String getAddr();
public native String getNameNAddr();
public native boolean isBlocked();
public native boolean isVerified();
public native int getId ();
public native String getName ();
public native String getDisplayName ();
public native String getFirstName ();
public native String getAddr ();
public native String getNameNAddr ();
public native boolean isBlocked ();
public native boolean isVerified ();
// working with raw c-data
private long contactCPtr; // CAVE: the name is referenced in the JNI
private native void unrefContactCPtr();
private long contactCPtr; // CAVE: the name is referenced in the JNI
private native void unrefContactCPtr ();
}