mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-17 19:18:06 +00:00
Few changes in JNI interface for linphone friends + fix issue in linphone_friend_destroy
This commit is contained in:
parent
1a4712e8cf
commit
1cc0a418af
4 changed files with 30 additions and 5 deletions
|
|
@ -396,8 +396,8 @@ void linphone_core_add_friend(LinphoneCore *lc, LinphoneFriend *lf)
|
|||
void linphone_core_remove_friend(LinphoneCore *lc, LinphoneFriend* fl){
|
||||
MSList *el=ms_list_find(lc->friends,(void *)fl);
|
||||
if (el!=NULL){
|
||||
lc->friends=ms_list_remove_link(lc->friends,el);
|
||||
linphone_friend_destroy((LinphoneFriend*)el->data);
|
||||
lc->friends=ms_list_remove_link(lc->friends,el);
|
||||
linphone_core_write_friends_config(lc);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1592,6 +1592,21 @@ extern "C" void Java_org_linphone_core_LinphoneFriendImpl_done(JNIEnv* env
|
|||
,jlong ptr) {
|
||||
linphone_friend_done((LinphoneFriend*)ptr);
|
||||
}
|
||||
extern "C" void Java_org_linphone_core_LinphoneCoreImpl_removeFriend(JNIEnv* env
|
||||
,jobject thiz
|
||||
,jlong ptr
|
||||
,jlong lf) {
|
||||
linphone_core_remove_friend((LinphoneCore*)ptr, (LinphoneFriend*)lf);
|
||||
}
|
||||
extern "C" jlong Java_org_linphone_core_LinphoneCoreImpl_getFriendByAddress(JNIEnv* env
|
||||
,jobject thiz
|
||||
,jlong ptr
|
||||
,jstring jaddress) {
|
||||
const char* address = env->GetStringUTFChars(jaddress, NULL);
|
||||
LinphoneFriend *lf = linphone_core_get_friend_by_address((LinphoneCore*)ptr, address);
|
||||
env->ReleaseStringUTFChars(jaddress, address);
|
||||
return (jlong) lf;
|
||||
}
|
||||
//LinphoneChatRoom
|
||||
extern "C" long Java_org_linphone_core_LinphoneChatRoomImpl_getPeerAddress(JNIEnv* env
|
||||
,jobject thiz
|
||||
|
|
|
|||
|
|
@ -20,9 +20,6 @@ package org.linphone.core;
|
|||
|
||||
import java.util.Vector;
|
||||
|
||||
import org.linphone.core.LinphoneCallLog;
|
||||
import org.linphone.core.LinphoneCallParams;
|
||||
|
||||
/**
|
||||
* Linphone core main object created by method {@link LinphoneCoreFactory#createLinphoneCore(LinphoneCoreListener, String, String, Object)}.
|
||||
*
|
||||
|
|
@ -802,4 +799,14 @@ public interface LinphoneCore {
|
|||
* return the version code of linphone core
|
||||
*/
|
||||
public String getVersion();
|
||||
|
||||
/**
|
||||
* remove a linphone friend from linphone core and linphonerc
|
||||
*/
|
||||
void removeFriend(LinphoneFriend lf);
|
||||
|
||||
/**
|
||||
* return a linphone friend (if exists) that matches the sip address
|
||||
*/
|
||||
LinphoneFriend findFriendByAddress(String sipUri);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -123,5 +123,8 @@ public interface LinphoneFriend {
|
|||
*/
|
||||
String toString();
|
||||
|
||||
|
||||
/**
|
||||
* Return the native pointer for this object
|
||||
*/
|
||||
long getNativePtr();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue