Commit 0a697d0d authored by Sylvain Berfini's avatar Sylvain Berfini 🎩
Browse files

Added a JNI method to know if a LinphoneFriend has been added to a LinphoneFriendList

parent 16fd894d
......@@ -3862,6 +3862,11 @@ extern "C" void Java_org_linphone_core_LinphoneFriendImpl_setPresenceModel(JNIEn
linphone_friend_set_presence_model(lf, model);
}
extern "C" jboolean Java_org_linphone_core_LinphoneFriendImpl_isAlreadyPresentInFriendList(JNIEnv* env, jobject thiz, jlong ptr) {
LinphoneFriend *lf = (LinphoneFriend *)ptr;
return (jboolean)lf->friend_list != NULL;
}
/*
* Class: org_linphone_core_LinphoneFriendImpl
* Method: getPresenceModel
......
......@@ -204,4 +204,9 @@ public interface LinphoneFriend {
String[] getPhoneNumbers();
void addPhoneNumber(String phone);
void removePhoneNumber(String phone);
/**
* Returns true if friend has already been added in a LinphoneFriendList, false otherwise
*/
boolean isAlreadyPresentInFriendList();
}
......@@ -225,4 +225,10 @@ class LinphoneFriendImpl implements LinphoneFriend, Serializable {
public void removePhoneNumber(String phone) {
removePhoneNumber(nativePtr, phone);
}
private native boolean isAlreadyPresentInFriendList(long nativePtr);
@Override
public boolean isAlreadyPresentInFriendList() {
return isAlreadyPresentInFriendList(nativePtr);
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment