add LinphoneChatMessage.getTo() java wrapper

This commit is contained in:
Simon Morlat 2014-08-12 17:09:01 +02:00
parent 032d83c830
commit a357f2fc86
3 changed files with 19 additions and 0 deletions

View file

@ -2589,6 +2589,12 @@ extern "C" jlong Java_org_linphone_core_LinphoneChatMessageImpl_getFrom(JNIEnv*
return (jlong) linphone_chat_message_get_from((LinphoneChatMessage*)ptr);
}
extern "C" jlong Java_org_linphone_core_LinphoneChatMessageImpl_getTo(JNIEnv* env
,jobject thiz
,jlong ptr) {
return (jlong) linphone_chat_message_get_to((LinphoneChatMessage*)ptr);
}
extern "C" jlong Java_org_linphone_core_LinphoneChatMessageImpl_getPeerAddress(JNIEnv* env
,jobject thiz
,jlong ptr) {

View file

@ -74,6 +74,12 @@ public interface LinphoneChatMessage {
*/
LinphoneAddress getFrom();
/**
* Get destination address of the LinphoneChatMessage.
* @return the LinphoneAddress in the To field of the message.
*/
LinphoneAddress getTo();
/**
* Linphone message can carry external body as defined by rfc2017
* @param message #LinphoneChatMessage
@ -147,4 +153,5 @@ public interface LinphoneChatMessage {
* @return an ErrorInfo.
*/
ErrorInfo getErrorInfo();
}

View file

@ -48,6 +48,12 @@ public class LinphoneChatMessageImpl implements LinphoneChatMessage {
return new LinphoneAddressImpl(getFrom(nativePtr),LinphoneAddressImpl.WrapMode.FromConst);
}
private native long getTo(long ptr);
@Override
public LinphoneAddress getTo() {
return new LinphoneAddressImpl(getTo(nativePtr),LinphoneAddressImpl.WrapMode.FromConst);
}
private native void addCustomHeader(long nativePtr, String name, String value);
@Override
public void addCustomHeader(String name, String value) {