mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-20 04:28:10 +00:00
Display if chat message delivered or not
This commit is contained in:
parent
4e5a4d36f1
commit
8fc61e182c
2 changed files with 47 additions and 2 deletions
38
LinphoneChatMessageImpl.java
Normal file
38
LinphoneChatMessageImpl.java
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
package org.linphone.core;
|
||||
|
||||
public class LinphoneChatMessageImpl implements LinphoneChatMessage {
|
||||
protected final long nativePtr;
|
||||
private native void setUserData(long ptr);
|
||||
private native String getMessage(long ptr);
|
||||
private native LinphoneAddress getPeerAddress(long ptr);
|
||||
|
||||
protected LinphoneChatMessageImpl(long aNativePtr) {
|
||||
nativePtr = aNativePtr;
|
||||
setUserData();
|
||||
}
|
||||
|
||||
public long getNativePtr() {
|
||||
return nativePtr;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getUserData() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setUserData() {
|
||||
setUserData(nativePtr);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage() {
|
||||
return getMessage(nativePtr);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LinphoneAddress getPeerAddress() {
|
||||
return getPeerAddress(nativePtr);
|
||||
}
|
||||
}
|
||||
|
|
@ -22,8 +22,10 @@ import org.linphone.core.LinphoneChatMessage.StateListener;
|
|||
|
||||
class LinphoneChatRoomImpl implements LinphoneChatRoom {
|
||||
protected final long nativePtr;
|
||||
private native long createLinphoneChatMessage(long ptr, String message);
|
||||
private native long getPeerAddress(long ptr);
|
||||
private native void sendMessage(long ptr, String message);
|
||||
private native void sendMessage2(long ptr, long message, StateListener listener);
|
||||
|
||||
protected LinphoneChatRoomImpl(long aNativePtr) {
|
||||
nativePtr = aNativePtr;
|
||||
|
|
@ -36,9 +38,10 @@ class LinphoneChatRoomImpl implements LinphoneChatRoom {
|
|||
public void sendMessage(String message) {
|
||||
sendMessage(nativePtr,message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendMessage(LinphoneChatMessage msg, StateListener listener) {
|
||||
// TODO To be implemened
|
||||
public void sendMessage(LinphoneChatMessage message, StateListener listener) {
|
||||
sendMessage2(nativePtr, message.getNativePtr(), listener);
|
||||
|
||||
}
|
||||
@Override
|
||||
|
|
@ -46,4 +49,8 @@ class LinphoneChatRoomImpl implements LinphoneChatRoom {
|
|||
// ignore, deprecated.
|
||||
|
||||
}
|
||||
@Override
|
||||
public LinphoneChatMessage createLinphoneChatMessage(String message) {
|
||||
return new LinphoneChatMessageImpl(createLinphoneChatMessage(nativePtr, message));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue