From 7cf48337eb6726ac8c971cb16a79ca899d44b8ae Mon Sep 17 00:00:00 2001
From: Andrea Gianarda <andrea.gianarda@belledonne-communications.com>
Date: Mon, 23 Oct 2023 16:31:34 +0200
Subject: [PATCH] Ensure that participant address has not a GRUU parameter

Fix incoherence between test name and function arguments
---
 src/conference/participant.cpp | 4 ++++
 src/conference/participant.h   | 4 +---
 tester/local_chat_tester.cpp   | 8 +++++++-
 3 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/src/conference/participant.cpp b/src/conference/participant.cpp
index a0a280bf85..a18b5c3b2f 100644
--- a/src/conference/participant.cpp
+++ b/src/conference/participant.cpp
@@ -244,6 +244,10 @@ void Participant::removeDevice(const std::shared_ptr<Address> &gruu) {
 
 // -----------------------------------------------------------------------------
 
+void Participant::setAddress(const std::shared_ptr<Address> &newAddr) {
+	addr = Address::create(newAddr->getUriWithoutGruu());
+}
+
 const std::shared_ptr<Address> &Participant::getAddress() const {
 	return addr;
 }
diff --git a/src/conference/participant.h b/src/conference/participant.h
index dcefcd4409..ac4c380c7f 100644
--- a/src/conference/participant.h
+++ b/src/conference/participant.h
@@ -173,9 +173,7 @@ protected:
 	inline void removeSession() {
 		session.reset();
 	}
-	inline void setAddress(const std::shared_ptr<Address> &addr) {
-		this->addr = addr;
-	}
+	void setAddress(const std::shared_ptr<Address> &addr);
 
 	std::shared_ptr<ParticipantDevice> addDevice(const std::shared_ptr<ParticipantDevice> &device);
 	std::shared_ptr<ParticipantDevice> addDevice(const std::shared_ptr<LinphonePrivate::CallSession> &session,
diff --git a/tester/local_chat_tester.cpp b/tester/local_chat_tester.cpp
index e6bcf29001..7c6b3049b9 100644
--- a/tester/local_chat_tester.cpp
+++ b/tester/local_chat_tester.cpp
@@ -1304,6 +1304,12 @@ static void group_chat_room_with_client_removed_while_stopped_base(bool_t use_re
 			LinphoneAccountParams *new_account_params = linphone_account_params_clone(account_params);
 			linphone_account_params_set_conference_factory_address(new_account_params,
 			                                                       focus.getConferenceFactoryAddress().toC());
+			LinphoneAddress *audio_video_conference_factory = linphone_address_new("sip:fakefactory@sip.example.org");
+			linphone_address_set_domain(audio_video_conference_factory,
+			                            linphone_address_get_domain(focus.getConferenceFactoryAddress().toC()));
+			linphone_account_params_set_audio_video_conference_factory_address(new_account_params,
+			                                                                   audio_video_conference_factory);
+			linphone_address_unref(audio_video_conference_factory);
 			linphone_account_set_params(account, new_account_params);
 			linphone_account_params_unref(new_account_params);
 		}
@@ -1466,7 +1472,7 @@ static void group_chat_room_with_client_removed_while_stopped_remote_list_event_
 }
 
 static void group_chat_room_with_client_removed_while_stopped_no_remote_list_event_handler(void) {
-	group_chat_room_with_client_removed_while_stopped_base(TRUE);
+	group_chat_room_with_client_removed_while_stopped_base(FALSE);
 }
 
 static void group_chat_room_with_creator_without_groupchat_capability_in_register(void) {
-- 
GitLab