From f23cfe27957aaf68d5335d2fe560c6016faac37a Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 30 Nov 2017 14:54:59 +0100 Subject: [PATCH] feat(c-core): wrap find one to one chat room function --- coreapi/chat.c | 19 +++++++++++++++---- include/linphone/core.h | 22 ++++++++++++++++++---- 2 files changed, 33 insertions(+), 8 deletions(-) diff --git a/coreapi/chat.c b/coreapi/chat.c index 2a2fac935..65f85d15a 100644 --- a/coreapi/chat.c +++ b/coreapi/chat.c @@ -106,15 +106,26 @@ LinphoneChatRoom *linphone_core_get_chat_room_from_uri(LinphoneCore *lc, const c LinphoneChatRoom *linphone_core_find_chat_room( const LinphoneCore *lc, - const LinphoneAddress *peerAddr, - const LinphoneAddress *localAddr + const LinphoneAddress *peer_addr, + const LinphoneAddress *local_addr ) { return L_GET_C_BACK_PTR(lc->cppCore->findChatRoom(LinphonePrivate::ChatRoomId( - LinphonePrivate::IdentityAddress(*L_GET_CPP_PTR_FROM_C_OBJECT(peerAddr)), - LinphonePrivate::IdentityAddress(*L_GET_CPP_PTR_FROM_C_OBJECT(localAddr)) + LinphonePrivate::IdentityAddress(*L_GET_CPP_PTR_FROM_C_OBJECT(peer_addr)), + LinphonePrivate::IdentityAddress(*L_GET_CPP_PTR_FROM_C_OBJECT(local_addr)) ))); } +LinphoneChatRoom *linphone_core_find_one_to_one_chat_room ( + const LinphoneCore *lc, + const LinphoneAddress *local_addr, + const LinphoneAddress *participant_addr +) { + return L_GET_C_BACK_PTR(lc->cppCore->findOneToOneChatRoom( + LinphonePrivate::IdentityAddress(*L_GET_CPP_PTR_FROM_C_OBJECT(local_addr)), + LinphonePrivate::IdentityAddress(*L_GET_CPP_PTR_FROM_C_OBJECT(participant_addr)) + )); +} + int linphone_core_message_received(LinphoneCore *lc, LinphonePrivate::SalOp *op, const SalMessage *sal_msg) { LinphoneReason reason = LinphoneReasonNotAcceptable; const char *peerAddress; diff --git a/include/linphone/core.h b/include/linphone/core.h index 9e627b785..ded1e3156 100644 --- a/include/linphone/core.h +++ b/include/linphone/core.h @@ -4962,14 +4962,28 @@ LINPHONE_PUBLIC LinphoneChatRoom *linphone_core_get_chat_room_from_uri(LinphoneC * Find a chat room. * No reference is transfered to the application. The LinphoneCore keeps a reference on the chat room. * @param lc the linphone core - * @param peerAddr a linphone address. - * @param localAddr a linphone address. + * @param peer_addr a linphone address. + * @param local_addr a linphone address. * @return #LinphoneChatRoom where messaging can take place. **/ LINPHONE_PUBLIC LinphoneChatRoom *linphone_core_find_chat_room ( const LinphoneCore *lc, - const LinphoneAddress *peerAddr, - const LinphoneAddress *localAddr + const LinphoneAddress *peer_addr, + const LinphoneAddress *local_addr +); + +/** + * Find a one to one chat room. + * No reference is transfered to the application. The LinphoneCore keeps a reference on the chat room. + * @param lc the linphone core + * @param local_addr a linphone address. + * @param participant_addr a linphone address. + * @return #LinphoneChatRoom where messaging can take place. +**/ +LINPHONE_PUBLIC LinphoneChatRoom *linphone_core_find_one_to_one_chat_room ( + const LinphoneCore *lc, + const LinphoneAddress *local_addr, + const LinphoneAddress *participant_addr ); /**