Commit 2c5d6910 authored by Erwan Croze's avatar Erwan Croze 👋🏻
Browse files

Add Lime JNI method

parent d2654ce5
......@@ -4317,7 +4317,9 @@ extern "C" jlong Java_org_linphone_core_LinphoneChatRoomImpl_createFileTransferM
return (jlong) message;
}
extern "C" jboolean Java_org_linphone_core_LinphoneChatRoomImpl_islimeAvailable(JNIEnv *env, jobject thiz, jlong ptr) {
return (jboolean) linphone_chat_room_lime_available((LinphoneChatRoom*)ptr);
}
extern "C" void Java_org_linphone_core_LinphoneChatMessageImpl_cancelFileTransfer(JNIEnv* env, jobject thiz, jlong ptr) {
linphone_chat_message_cancel_file_transfer((LinphoneChatMessage *)ptr);
......
......@@ -33,13 +33,13 @@ public interface LinphoneChatRoom {
* @return LinphoneAddress peer address
*/
LinphoneAddress getPeerAddress();
/**
* send a message to peer member of this chat room.
* @param message to be sent
*/
void sendMessage(String message);
/**
* Send a message to peer member of this chat room.
* @param message chat message
......@@ -120,26 +120,26 @@ public interface LinphoneChatRoom {
* @return LinphoneChatMessage object
*/
LinphoneChatMessage createLinphoneChatMessage(String message, String url, State state, long timestamp, boolean isRead, boolean isIncoming);
/**
* Returns a back pointer to the core managing the chat room.
* @return the LinphoneCore
*/
LinphoneCore getCore();
/**
* Create a message attached to a dedicated chat room with a particular content.
* @param content LinphoneContent initial content.
* @return a new LinphoneChatMessage
*/
LinphoneChatMessage createFileTransferMessage(LinphoneContent content);
/**
*
*
* @param message
*/
void sendChatMessage(LinphoneChatMessage message);
/**
* get Curent Call associated to this chatroom if any
* To commit a message, use #linphone_chat_room_send_message
......@@ -152,6 +152,11 @@ public interface LinphoneChatRoom {
* @return RFC 4103/T.140 char
*/
long getChar();
/**
* Return if lime is available in this room
* @param cr: chat room
* @return
*/
boolean islimeAvailable();
}
......@@ -44,14 +44,15 @@ class LinphoneChatRoomImpl implements LinphoneChatRoom {
boolean isIncoming);
private native void sendChatMessage(long ptr, Object message, long messagePtr);
private native void finalize(long nativePtr);
private native boolean islimeAvailable(long nativePtr);
protected void finalize() throws Throwable {
if (nativePtr != 0) {
finalize(nativePtr);
}
super.finalize();
}
protected LinphoneChatRoomImpl(long aNativePtr) {
nativePtr = aNativePtr;
}
......@@ -160,7 +161,7 @@ class LinphoneChatRoomImpl implements LinphoneChatRoom {
private LinphoneChatMessage[] getHistoryPrivate(Object[] typesPtr) {
return (LinphoneChatMessage[]) typesPtr;
}
private native long createFileTransferMessage(long ptr, String name, String type, String subtype, int size);
@Override
public LinphoneChatMessage createFileTransferMessage(LinphoneContent content) {
......@@ -172,16 +173,21 @@ class LinphoneChatRoomImpl implements LinphoneChatRoom {
public void sendChatMessage(LinphoneChatMessage message) {
sendChatMessage(nativePtr, message, ((LinphoneChatMessageImpl)message).getNativePtr());
}
private native Object getCall(long nativePtr);
@Override
public LinphoneCall getCall() {
return (LinphoneCall) getCall(nativePtr);
}
private native long getChar(long nativePtr);
@Override
public long getChar() {
return getChar(nativePtr);
}
@Override
public boolean islimeAvailable() {
return islimeAvailable(nativePtr);
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment