Commit 8fbe7ee1 authored by Sylvain Berfini's avatar Sylvain Berfini
Browse files

Added JNI glue for deleteHistory and getUnreadMessagesCount methods of LinphoneChatRoom

parent 3e2f306e
...@@ -2078,6 +2078,16 @@ extern "C" jlong Java_org_linphone_core_LinphoneChatRoomImpl_createLinphoneChatM ...@@ -2078,6 +2078,16 @@ extern "C" jlong Java_org_linphone_core_LinphoneChatRoomImpl_createLinphoneChatM
return (jlong) chatMessage; return (jlong) chatMessage;
} }
extern "C" jint Java_org_linphone_core_LinphoneChatRoomImpl_getUnreadMessagesCount(JNIEnv* env
,jobject thiz
,jlong ptr) {
return (jint) linphone_chat_room_get_unread_messages_count((LinphoneChatRoom*)ptr);
}
extern "C" void Java_org_linphone_core_LinphoneChatRoomImpl_deleteHistory(JNIEnv* env
,jobject thiz
,jlong ptr) {
linphone_chat_room_delete_history((LinphoneChatRoom*)ptr);
}
extern "C" void Java_org_linphone_core_LinphoneChatRoomImpl_destroy(JNIEnv* env extern "C" void Java_org_linphone_core_LinphoneChatRoomImpl_destroy(JNIEnv* env
,jobject thiz ,jobject thiz
,jlong ptr) { ,jlong ptr) {
......
...@@ -59,4 +59,15 @@ public interface LinphoneChatRoom { ...@@ -59,4 +59,15 @@ public interface LinphoneChatRoom {
* Destroys a LinphoneChatRoom. * Destroys a LinphoneChatRoom.
*/ */
void destroy(); void destroy();
/**
* Returns the amount of unread messages associated with the peer of this chatRoom.
* @return the amount of unread messages
*/
int getUnreadMessagesCount();
/**
* Deletes all the messages associated with the peer of this chat room
*/
void deleteHistory();
} }
...@@ -28,6 +28,8 @@ class LinphoneChatRoomImpl implements LinphoneChatRoom { ...@@ -28,6 +28,8 @@ class LinphoneChatRoomImpl implements LinphoneChatRoom {
private native void sendMessage2(long ptr, long message, StateListener listener); private native void sendMessage2(long ptr, long message, StateListener listener);
private native long[] getHistory(long ptr); private native long[] getHistory(long ptr);
private native void destroy(long ptr); private native void destroy(long ptr);
private native int getUnreadMessagesCount(long ptr);
private native void deleteHistory(long ptr);
protected LinphoneChatRoomImpl(long aNativePtr) { protected LinphoneChatRoomImpl(long aNativePtr) {
nativePtr = aNativePtr; nativePtr = aNativePtr;
...@@ -67,4 +69,12 @@ class LinphoneChatRoomImpl implements LinphoneChatRoom { ...@@ -67,4 +69,12 @@ class LinphoneChatRoomImpl implements LinphoneChatRoom {
public void destroy() { public void destroy() {
destroy(nativePtr); destroy(nativePtr);
} }
public int getUnreadMessagesCount() {
return getUnreadMessagesCount(nativePtr);
}
public void deleteHistory() {
deleteHistory(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