fix errors in the file transfer API design that were also wrapped in java.

This commit is contained in:
Simon Morlat 2014-11-14 18:58:51 +01:00
parent 916a3e8e02
commit c828b54b33
5 changed files with 13 additions and 14 deletions

View file

@ -2685,8 +2685,8 @@ extern "C" jlong Java_org_linphone_core_LinphoneChatRoomImpl_createFileTransferM
return (jlong) message;
}
extern "C" void Java_org_linphone_core_LinphoneChatRoomImpl_cancelFileTransfer(JNIEnv* env, jobject thiz, jlong ptr, jlong message) {
linphone_chat_room_cancel_file_transfer((LinphoneChatMessage *)message);
extern "C" void Java_org_linphone_core_LinphoneChatMessageImpl_cancelFileTransfer(JNIEnv* env, jobject thiz, jlong ptr) {
linphone_chat_message_cancel_file_transfer((LinphoneChatMessage *)ptr);
}
extern "C" jobject Java_org_linphone_core_LinphoneChatMessageImpl_getFileTransferInformation(JNIEnv* env, jobject thiz, jlong ptr) {

View file

@ -163,6 +163,10 @@ public interface LinphoneChatMessage {
*/
void startFileDownload(LinphoneChatMessage.StateListener listener);
/**
* Cancel an ongoing file transfer attached to this message.(upload or download).
*/
void cancelFileTransfer();
/**
* Get the file_transfer_information (used by call backs to recover informations during a rcs file transfer)
* @return a pointer to the LinphoneContent structure or NULL if not present.
@ -179,4 +183,5 @@ public interface LinphoneChatMessage {
* @return the data stored in the chat message if any, else null
*/
String getAppData();
}

View file

@ -144,9 +144,4 @@ public interface LinphoneChatRoom {
*/
LinphoneChatMessage createFileTransferMessage(LinphoneContent content);
/**
* Cancel an ongoing file transfer attached to this message (upload or download)
* @param message
*/
void cancelFileTransfer(LinphoneChatMessage message);
}

View file

@ -127,4 +127,10 @@ public class LinphoneChatMessageImpl implements LinphoneChatMessage {
public String getAppData() {
return getAppData(nativePtr);
}
private native void cancelFileTransfer(long messagePtr);
@Override
public void cancelFileTransfer() {
cancelFileTransfer(nativePtr);
}
}

View file

@ -177,11 +177,4 @@ class LinphoneChatRoomImpl implements LinphoneChatRoom {
}
}
private native void cancelFileTransfer(long ptr, long messagePtr);
@Override
public void cancelFileTransfer(LinphoneChatMessage message) {
synchronized(getCore()) {
cancelFileTransfer(nativePtr, ((LinphoneChatMessageImpl)message).getNativePtr());
}
}
}