From 1cf4eda4aac0fdd1fdac150f6e0592368bf93459 Mon Sep 17 00:00:00 2001 From: Erwan Croze Date: Wed, 1 Feb 2017 14:53:36 +0100 Subject: [PATCH] Add chat message is secured JNI --- coreapi/linphonecore_jni.cc | 6 ++ .../linphone/core/LinphoneChatMessage.java | 67 ++++++++++--------- .../core/LinphoneChatMessageImpl.java | 50 ++++++++------ 3 files changed, 71 insertions(+), 52 deletions(-) diff --git a/coreapi/linphonecore_jni.cc b/coreapi/linphonecore_jni.cc index b6fe8961f..c6abca0e8 100644 --- a/coreapi/linphonecore_jni.cc +++ b/coreapi/linphonecore_jni.cc @@ -4480,6 +4480,12 @@ extern "C" jint Java_org_linphone_core_LinphoneChatMessageImpl_downloadFile(JNIE return (jint) linphone_chat_message_download_file((LinphoneChatMessage*)ptr); } +extern "C" jboolean Java_org_linphone_core_LinphoneChatMessageImpl_isSecured(JNIEnv* env + ,jobject thiz + ,jlong ptr) { + return linphone_chat_message_is_secured((LinphoneChatMessage*)ptr); +} + static void message_state_changed(LinphoneChatMessage* msg, LinphoneChatMessageState state) { JNIEnv *env = 0; jint result = jvm->AttachCurrentThread(&env,NULL); diff --git a/java/common/org/linphone/core/LinphoneChatMessage.java b/java/common/org/linphone/core/LinphoneChatMessage.java index 20a49acd7..07f2227f5 100644 --- a/java/common/org/linphone/core/LinphoneChatMessage.java +++ b/java/common/org/linphone/core/LinphoneChatMessage.java @@ -8,17 +8,17 @@ public interface LinphoneChatMessage { interface StateListener { void onLinphoneChatMessageStateChanged(LinphoneChatMessage msg, State state); } - + interface LinphoneChatMessageListener { void onLinphoneChatMessageStateChanged(LinphoneChatMessage msg, State state); - + /** * This function is called by the core upon an incoming File transfer is started. This function may be call several time for the same file in case of large file. * @param content incoming content information * @param buffer holding the received data. Empty buffer means end of file. */ void onLinphoneChatMessageFileTransferReceived(LinphoneChatMessage msg, LinphoneContent content, LinphoneBuffer buffer); - + /** * This function is called by the core when an outgoing file transfer is started. This function is called until size is set to 0. * @param content incoming content information @@ -27,7 +27,7 @@ public interface LinphoneChatMessage { * @param bufferToFill A LinphoneBuffer object holding the data written by the application. An empty buffer means end of file. */ void onLinphoneChatMessageFileTransferSent(LinphoneChatMessage msg, LinphoneContent content, int offset, int size, LinphoneBuffer bufferToFill); - + /** * File transfer progress indication callback prototype. * @param content incoming content information @@ -40,7 +40,7 @@ public interface LinphoneChatMessage { static private Vector values = new Vector(); private final int mValue; public final int value() {return mValue;} - + private final String mStringValue; /** * Initial state @@ -74,13 +74,13 @@ public interface LinphoneChatMessage { * Message displayed to the remote user */ public final static State Displayed = new State(7,"Displayed"); - + private State(int value,String stringValue) { mValue = value; values.addElement(this); mStringValue=stringValue; } - + public static State fromInt(int value) { for (int i=0; i