From 2804666ea8ea99e72dcee3cca6c12837fcee1288 Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Fri, 22 Oct 2010 18:33:55 +0200 Subject: [PATCH] add presence and messaging apis --- LinphoneCoreFactoryImpl.java | 10 ++++++++++ LinphoneCoreImpl.java | 17 +++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/LinphoneCoreFactoryImpl.java b/LinphoneCoreFactoryImpl.java index 712e27b63..a6f899f31 100644 --- a/LinphoneCoreFactoryImpl.java +++ b/LinphoneCoreFactoryImpl.java @@ -68,4 +68,14 @@ public class LinphoneCoreFactoryImpl extends LinphoneCoreFactory { //not implemented on Android } + + @Override + LinphoneFriend createLinphoneFriend(String friendUri) { + return new LinphoneFriendImpl(friendUri); + } + + @Override + LinphoneFriend createLinphoneFriend() { + return createLinphoneFriend(null); + } } diff --git a/LinphoneCoreImpl.java b/LinphoneCoreImpl.java index e042b3951..0143dc7d5 100644 --- a/LinphoneCoreImpl.java +++ b/LinphoneCoreImpl.java @@ -64,6 +64,10 @@ class LinphoneCoreImpl implements LinphoneCore { private native void playDtmf(long nativePtr,char dtmf,int duration); private native void stopDtmf(long nativePtr); + private native void addFriend(long nativePtr,long friend); + private native void setPresenceInfo(long nativePtr,int minute_away, String alternative_contact,int status); + private native long createChatRoom(long nativePtr,String to); + LinphoneCoreImpl(LinphoneCoreListener listener, File userConfig,File factoryConfig,Object userdata) throws IOException { mListener=listener; nativePtr = newLinphoneCore(listener,userConfig.getCanonicalPath(),factoryConfig.getCanonicalPath(),userdata); @@ -270,5 +274,18 @@ class LinphoneCoreImpl implements LinphoneCore { public void stopDtmf() { stopDtmf(nativePtr); } + + public void addFriend(LinphoneFriend lf) throws LinphoneCoreException { + addFriend(nativePtr,((LinphoneFriendImpl)lf).nativePtr); + + } + public void setPresenceInfo(int minute_away, String alternative_contact, + OnlineStatus status) { + setPresenceInfo(nativePtr,minute_away,alternative_contact,status.mValue); + + } + public LinphoneChatRoom createChatRoom(String to) { + return new LinphoneChatRoomImpl(createChatRoom(nativePtr,to)); + } }