From 9b68f188203da0fc33d875cd5dd7024b3b9604bb Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Thu, 28 Aug 2014 14:59:00 +0200 Subject: [PATCH] keep linphone_core_get_chat_room(LinphoneCore *lc, const LinphoneAddress *addr) with const param --- coreapi/chat.c | 4 ++-- coreapi/linphonecore.h | 2 +- tester/message_tester.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/coreapi/chat.c b/coreapi/chat.c index 30098daa1..2891fafd5 100644 --- a/coreapi/chat.c +++ b/coreapi/chat.c @@ -342,10 +342,10 @@ LinphoneChatRoom * linphone_core_create_chat_room(LinphoneCore *lc, const char * * @param addr a linphone address. * @returns #LinphoneChatRoom where messaging can take place. **/ -LinphoneChatRoom *linphone_core_get_chat_room(LinphoneCore *lc, LinphoneAddress *addr){ +LinphoneChatRoom *linphone_core_get_chat_room(LinphoneCore *lc, const LinphoneAddress *addr){ LinphoneChatRoom *ret = _linphone_core_get_chat_room(lc, addr); if (!ret) { - ret = _linphone_core_create_chat_room(lc, addr); + ret = _linphone_core_create_chat_room(lc, linphone_address_clone(addr)); } return ret; } diff --git a/coreapi/linphonecore.h b/coreapi/linphonecore.h index 017fb694d..415645812 100644 --- a/coreapi/linphonecore.h +++ b/coreapi/linphonecore.h @@ -1374,7 +1374,7 @@ typedef void (*LinphoneChatMessageStateChangedCb)(LinphoneChatMessage* msg,Linph LINPHONE_PUBLIC void linphone_core_set_chat_database_path(LinphoneCore *lc, const char *path); LINPHONE_PUBLIC LinphoneChatRoom * linphone_core_create_chat_room(LinphoneCore *lc, const char *to); LINPHONE_PUBLIC LinphoneChatRoom * linphone_core_get_or_create_chat_room(LinphoneCore *lc, const char *to); -LINPHONE_PUBLIC LinphoneChatRoom *linphone_core_get_chat_room(LinphoneCore *lc, LinphoneAddress *addr); +LINPHONE_PUBLIC LinphoneChatRoom *linphone_core_get_chat_room(LinphoneCore *lc, const LinphoneAddress *addr); LINPHONE_PUBLIC LinphoneChatRoom *linphone_core_get_chat_room_from_uri(LinphoneCore *lc, const char *to); LINPHONE_PUBLIC void linphone_core_disable_chat(LinphoneCore *lc, LinphoneReason deny_reason); LINPHONE_PUBLIC void linphone_core_enable_chat(LinphoneCore *lc); diff --git a/tester/message_tester.c b/tester/message_tester.c index 9a0a21b6c..10bc09795 100644 --- a/tester/message_tester.c +++ b/tester/message_tester.c @@ -257,7 +257,7 @@ static void text_message_with_privacy(void) { linphone_core_get_default_proxy(pauline->lc,&pauline_proxy); linphone_proxy_config_set_privacy(pauline_proxy,LinphonePrivacyId); - CU_ASSERT_PTR_NULL(linphone_core_get_chat_room(marie->lc,pauline->identity)); + CU_ASSERT_PTR_NOT_NULL(linphone_core_get_chat_room(marie->lc,pauline->identity)); linphone_chat_room_send_message(chat_room,"Bla bla bla bla"); CU_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&marie->stat.number_of_LinphoneMessageReceived,1));