Commit ea085a42 authored by Ghislain MARY's avatar Ghislain MARY
Browse files

Allow setting an invalid conference address to a server group chat room to...

Allow setting an invalid conference address to a server group chat room to notify the address has not been generated succesfully and to send an error to the client.
parent bf8735e4
Pipeline #281 failed with stage
in 0 seconds
......@@ -368,11 +368,14 @@ const bctbx_list_t *linphone_chat_room_get_composing_addresses (LinphoneChatRoom
}
void linphone_chat_room_set_conference_address (LinphoneChatRoom *cr, const LinphoneAddress *confAddr) {
char *addrStr = linphone_address_as_string(confAddr);
char *addrStr = confAddr ? linphone_address_as_string(confAddr) : nullptr;
LinphonePrivate::ServerGroupChatRoomPrivate *sgcr = dynamic_cast<LinphonePrivate::ServerGroupChatRoomPrivate *>(L_GET_PRIVATE_FROM_C_OBJECT(cr));
if (sgcr)
sgcr->setConferenceAddress(LinphonePrivate::IdentityAddress(addrStr));
bctbx_free(addrStr);
if (sgcr) {
LinphonePrivate::IdentityAddress idAddr = addrStr ? LinphonePrivate::IdentityAddress(addrStr) : LinphonePrivate::IdentityAddress("");
sgcr->setConferenceAddress(idAddr);
}
if (addrStr)
bctbx_free(addrStr);
}
void linphone_chat_room_set_participant_devices (LinphoneChatRoom *cr, const LinphoneAddress *partAddr, const bctbx_list_t *partDevices) {
......
......@@ -395,6 +395,14 @@ LinphoneReason ServerGroupChatRoomPrivate::onSipMessageReceived (SalOp *op, cons
void ServerGroupChatRoomPrivate::setConferenceAddress (const IdentityAddress &conferenceAddress) {
L_Q();
L_Q_T(LocalConference, qConference);
if (!conferenceAddress.isValid()) {
shared_ptr<CallSession> session = q->getMe()->getPrivate()->getSession();
session->decline(LinphoneReasonServerTimeout);
setState(ChatRoom::State::CreationFailed);
return;
}
if (q->getState() != ChatRoom::State::Instantiated) {
lError() << "Cannot set the conference address of the ServerGroupChatRoom in state " << Utils::toString(q->getState());
return;
......
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