Commit 16e21507 authored by Sylvain Berfini's avatar Sylvain Berfini 🎩
Browse files

Added method to set PreseceModel to a LinphoneFriend

parent 9ea6076d
......@@ -3643,7 +3643,7 @@ extern "C" void Java_org_linphone_core_LinphoneFriendImpl_finalize(JNIEnv* env
linphone_friend_unref(lfriend);
}
extern "C" void Java_org_linphone_core_LinphoneFriendListImpl_finalize(JNIEnv* env
extern "C" void Java_org_linphone_core_LinphoneFriendListImpl_finalize(JNIEnv* env
,jobject thiz
,jlong ptr) {
LinphoneFriendList *lfriendList=(LinphoneFriendList*)ptr;
......@@ -3651,6 +3651,12 @@ extern "C" void Java_org_linphone_core_LinphoneFriendListImpl_finalize(JNIEnv*
linphone_friend_list_unref(lfriendList);
}
extern "C" void Java_org_linphone_core_LinphoneFriendImpl_setPresenceModel(JNIEnv *env, jobject jobj, jlong ptr, jlong modelPtr) {
LinphoneFriend *lf = (LinphoneFriend *)ptr;
LinphonePresenceModel *model = (LinphonePresenceModel *)modelPtr;
linphone_friend_set_presence_model(lf, model);
}
/*
* Class: org_linphone_core_LinphoneFriendImpl
* Method: getPresenceModel
......
......@@ -113,6 +113,11 @@ public interface LinphoneFriend {
* @return A #PresenceModel object, or null if the friend do not have presence information (in which case he is considered offline)
*/
PresenceModel getPresenceModel();
/**
* @brief Set the presence information of a friend
* @param presenceModel A #PresenceModel object
*/
void setPresenceModel(PresenceModel presenceModel);
/**
* Starts editing a friend configuration.
*<br> Because friend configuration must be consistent, applications MUST call {@link #edit()} before doing any attempts to modify friend configuration (such as address or subscription policy and so on).
......
......@@ -88,6 +88,9 @@ class LinphoneFriendImpl implements LinphoneFriend, Serializable {
public PresenceModel getPresenceModel() {
return (PresenceModel)getPresenceModel(nativePtr);
}
public void setPresenceModel(PresenceModel presenceModel) {
setPresenceModel(nativePtr, ((PresenceModelImpl)presenceModel).getNativePtr());
}
public void edit() {
synchronized(getSyncObject()){
edit(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