mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-21 13:08:08 +00:00
Added JNI glue for deleteHistory and getUnreadMessagesCount methods of LinphoneChatRoom
This commit is contained in:
parent
3e2f306e36
commit
8fbe7ee1d4
3 changed files with 31 additions and 0 deletions
|
|
@ -2078,6 +2078,16 @@ extern "C" jlong Java_org_linphone_core_LinphoneChatRoomImpl_createLinphoneChatM
|
|||
|
||||
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
|
||||
,jobject thiz
|
||||
,jlong ptr) {
|
||||
|
|
|
|||
|
|
@ -59,4 +59,15 @@ public interface LinphoneChatRoom {
|
|||
* Destroys a LinphoneChatRoom.
|
||||
*/
|
||||
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 {
|
|||
private native void sendMessage2(long ptr, long message, StateListener listener);
|
||||
private native long[] getHistory(long ptr);
|
||||
private native void destroy(long ptr);
|
||||
private native int getUnreadMessagesCount(long ptr);
|
||||
private native void deleteHistory(long ptr);
|
||||
|
||||
protected LinphoneChatRoomImpl(long aNativePtr) {
|
||||
nativePtr = aNativePtr;
|
||||
|
|
@ -67,4 +69,12 @@ class LinphoneChatRoomImpl implements LinphoneChatRoom {
|
|||
public void destroy() {
|
||||
destroy(nativePtr);
|
||||
}
|
||||
|
||||
public int getUnreadMessagesCount() {
|
||||
return getUnreadMessagesCount(nativePtr);
|
||||
}
|
||||
|
||||
public void deleteHistory() {
|
||||
deleteHistory(nativePtr);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue