diff --git a/coreapi/chat.c b/coreapi/chat.c index 2a1df989d0ea23991321ab087889e405b7a67a64..0088ab5365d6032b6f928d17865ba14212d156fb 100644 --- a/coreapi/chat.c +++ b/coreapi/chat.c @@ -61,7 +61,7 @@ LinphoneChatRoom *linphone_core_create_client_group_chat_room(LinphoneCore *lc, return linphone_core_create_client_group_chat_room_2(lc, subject, fallback, FALSE); } -// Deprecated see linphone_core_create_chat_room_6 +// Deprecated see linphone_core_create_chat_room_7 LinphoneChatRoom *linphone_core_create_client_group_chat_room_2(LinphoneCore *lc, const char *subject, bool_t fallback, @@ -71,7 +71,7 @@ LinphoneChatRoom *linphone_core_create_client_group_chat_room_2(LinphoneCore *lc ->toC(); } -// Deprecated see linphone_core_create_chat_room_6 +// Deprecated see linphone_core_create_chat_room_7 LinphoneChatRoom *linphone_core_create_chat_room(LinphoneCore *lc, const LinphoneChatRoomParams *params, const LinphoneAddress *localAddr, @@ -84,7 +84,7 @@ LinphoneChatRoom *linphone_core_create_chat_room(LinphoneCore *lc, return result; } -// Deprecated see linphone_core_create_chat_room_6 +// Deprecated see linphone_core_create_chat_room_7 LinphoneChatRoom *linphone_core_create_chat_room_2(LinphoneCore *lc, const LinphoneChatRoomParams *params, const char *subject, @@ -96,7 +96,7 @@ LinphoneChatRoom *linphone_core_create_chat_room_2(LinphoneCore *lc, return result; } -// Deprecated see linphone_core_create_chat_room_6 +// Deprecated see linphone_core_create_chat_room_7 LinphoneChatRoom * linphone_core_create_chat_room_3(LinphoneCore *lc, const char *subject, const bctbx_list_t *participants) { LinphoneChatRoomParams *params = linphone_core_create_default_chat_room_params(lc); @@ -106,7 +106,7 @@ linphone_core_create_chat_room_3(LinphoneCore *lc, const char *subject, const bc return result; } -// Deprecated see linphone_core_create_chat_room_6 +// Deprecated see linphone_core_create_chat_room_7 LinphoneChatRoom *linphone_core_create_chat_room_4(LinphoneCore *lc, const LinphoneChatRoomParams *params, const LinphoneAddress *localAddr, @@ -117,7 +117,7 @@ LinphoneChatRoom *linphone_core_create_chat_room_4(LinphoneCore *lc, return result; } -// Deprecated see linphone_core_create_chat_room_6 +// Deprecated see linphone_core_create_chat_room_7 LinphoneChatRoom *linphone_core_create_chat_room_5(LinphoneCore *lc, const LinphoneAddress *participant) { bctbx_list_t *paricipants = bctbx_list_prepend(NULL, (LinphoneAddress *)participant); LinphoneChatRoomParams *params = linphone_core_create_default_chat_room_params(lc); @@ -141,13 +141,8 @@ LinphoneChatRoom *linphone_core_create_chat_room_7(LinphoneCore *lc, CoreLogContextualizer logContextualizer(lc); shared_ptr<LinphonePrivate::ConferenceParams> conferenceParams = params ? LinphonePrivate::ConferenceParams::toCpp(params)->clone()->toSharedPtr() : nullptr; - // If a participant has an invalid address, the pointer to its address is NULL. - // For the purpose of building an std::list from a bctbx_list_t, replace it by an empty Address (that is invalid) - std::list<std::shared_ptr<const LinphonePrivate::Address>> participantsList; - for (const bctbx_list_t *elem = participants; elem != NULL; elem = elem->next) { - const LinphoneAddress *data = static_cast<const LinphoneAddress *>(bctbx_list_get_data(elem)); - participantsList.push_back(LinphonePrivate::Address::toCpp(data)->getSharedFromThis()); - } + const list<std::shared_ptr<LinphonePrivate::Address>> participantsList = + LinphonePrivate::Utils::bctbxListToCppSharedPtrList<LinphoneAddress, Address>(participants); shared_ptr<const LinphonePrivate::Address> localAddress = localAddr ? LinphonePrivate::Address::toCpp(localAddr)->getSharedFromThis() : L_GET_PRIVATE_FROM_C_OBJECT(lc)->getDefaultLocalAddress(nullptr, false); @@ -178,13 +173,8 @@ LinphoneChatRoom *linphone_core_search_chat_room_2(const LinphoneCore *lc, CoreLogContextualizer logContextualizer(lc); shared_ptr<LinphonePrivate::ConferenceParams> conferenceParams = params ? LinphonePrivate::ConferenceParams::toCpp(params)->clone()->toSharedPtr() : nullptr; - // If a participant has an invalid address, the pointer to its address is NULL. - // For the purpose of building an std::list from a bctbx_list_t, replace it by an empty Address (that is invalid) - std::list<std::shared_ptr<const LinphonePrivate::Address>> participantsList; - for (const bctbx_list_t *elem = participants; elem != NULL; elem = elem->next) { - const LinphoneAddress *data = static_cast<const LinphoneAddress *>(bctbx_list_get_data(elem)); - participantsList.push_back(LinphonePrivate::Address::toCpp(data)->getSharedFromThis()); - } + const list<std::shared_ptr<LinphonePrivate::Address>> participantsList = + LinphonePrivate::Utils::bctbxListToCppSharedPtrList<LinphoneAddress, Address>(participants); shared_ptr<const LinphonePrivate::Address> localAddress = localAddr ? LinphonePrivate::Address::toCpp(localAddr)->getSharedFromThis() : nullptr; shared_ptr<const LinphonePrivate::Address> remoteAddress = diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 490035b01262dba1353d2fc9d3bd8b7a3d7c2dbe..420a1e99e7236cddf8a77aea980dd10e30fd5e1b 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -9488,12 +9488,11 @@ LinphoneConference *linphone_core_search_conference(const LinphoneCore *lc, CoreLogContextualizer logContextualizer(lc); shared_ptr<LinphonePrivate::ConferenceParams> conferenceParams = params ? LinphonePrivate::ConferenceParams::toCpp(params)->clone()->toSharedPtr() : nullptr; - // If a participant has an invalid address, the pointer to its address is NULL. - // For the purpose of building an std::list from a bctbx_list_t, replace it by an empty Address (that is invalid) - std::list<std::shared_ptr<const LinphonePrivate::Address>> participantsList; - for (const bctbx_list_t *elem = participants; elem != NULL; elem = elem->next) { - const LinphoneAddress *data = static_cast<const LinphoneAddress *>(bctbx_list_get_data(elem)); - participantsList.push_back(LinphonePrivate::Address::toCpp(data)->getSharedFromThis()); + list<std::shared_ptr<LinphonePrivate::Address>> participantsList; + if (participants) { + participantsList = + LinphonePrivate::Utils::bctbxListToCppSharedPtrList<LinphoneAddress, LinphonePrivate::Address>( + participants); } shared_ptr<const LinphonePrivate::Address> localAddress = localAddr ? LinphonePrivate::Address::getSharedFromThis(localAddr) : nullptr; diff --git a/include/linphone/types.h b/include/linphone/types.h index 6bb33430dc93c9293c67c98af4b27c294003e777..2fbda5a93dd43a56d226b8afba8c3ba168f184ae 100644 --- a/include/linphone/types.h +++ b/include/linphone/types.h @@ -719,7 +719,7 @@ typedef enum _LinphoneLogCollectionState { } LinphoneLogCollectionState; /** - * @brief Used to notify if log collection upload have been succesfully delivered or not. + * @brief Used to notify if log collection upload have been successfully delivered or not. * @ingroup initializing */ typedef enum _LinphoneCoreLogCollectionUploadState { @@ -1353,7 +1353,7 @@ typedef struct _LinphoneRange LinphoneRange; /** * @brief Status code returned by some functions to - * notify whether the execution has been succesfully + * notify whether the execution has been successfully * done or not. * @ingroup misc */ diff --git a/plugins/example/exampleplugin.cpp b/plugins/example/exampleplugin.cpp index 02294c0071af85376978360f8a671bab3e6ab780..f5056d53f1f88e8df2ad44635f82dda2e001de0c 100644 --- a/plugins/example/exampleplugin.cpp +++ b/plugins/example/exampleplugin.cpp @@ -34,7 +34,7 @@ extern "C" { #endif PLUGIN_EXPORT void liblinphone_exampleplugin_init(LinphoneCore *core) { lInfo() << "Example plugin for core " << std::string(linphone_core_get_identity(core)) - << " has been succesfully loaded"; + << " has been successfully loaded"; } #ifdef __cplusplus diff --git a/src/c-wrapper/api/c-chat-room.cpp b/src/c-wrapper/api/c-chat-room.cpp index ce37eedb65cb6d99e852b33274e952c060e4bae7..56f5aeb61257b5610ed95b5ef88b1e3ed51f927a 100644 --- a/src/c-wrapper/api/c-chat-room.cpp +++ b/src/c-wrapper/api/c-chat-room.cpp @@ -469,11 +469,8 @@ void linphone_chat_room_add_participant(LinphoneChatRoom *chat_room, LinphoneAdd bool_t linphone_chat_room_add_participants(LinphoneChatRoom *chat_room, const bctbx_list_t *addresses) { LinphonePrivate::ChatRoomLogContextualizer logContextualizer(chat_room); if (linphone_chat_room_can_handle_participants(chat_room)) { - std::list<std::shared_ptr<const LinphonePrivate::Address>> addressList; - for (const bctbx_list_t *elem = addresses; elem != NULL; elem = elem->next) { - const LinphoneAddress *data = static_cast<const LinphoneAddress *>(bctbx_list_get_data(elem)); - addressList.push_back(LinphonePrivate::Address::toCpp(data)->getSharedFromThis()); - } + std::list<std::shared_ptr<LinphonePrivate::Address>> addressList = + LinphonePrivate::Utils::bctbxListToCppSharedPtrList<LinphoneAddress, LinphonePrivate::Address>(addresses); return AbstractChatRoom::toCpp(chat_room)->getConference()->addParticipants(addressList); } return FALSE; @@ -570,7 +567,7 @@ void linphone_chat_room_remove_participants(LinphoneChatRoom *chat_room, const b ChatRoomLogContextualizer logContextualizer(chat_room); if (linphone_chat_room_can_handle_participants(chat_room)) { AbstractChatRoom::toCpp(chat_room)->getConference()->removeParticipants( - Participant::getCppListFromCList(participants)); + Utils::bctbxListToCppSharedPtrList<LinphoneParticipant, Participant>(participants)); } } @@ -644,7 +641,8 @@ void linphone_chat_room_set_participant_devices(LinphoneChatRoom *chat_room, const bctbx_list_t *deviceIdentities) { #ifdef HAVE_ADVANCED_IM list<shared_ptr<ParticipantDeviceIdentity>> lDevicesIdentities = - ParticipantDeviceIdentity::getCppListFromCList(deviceIdentities); + Utils::bctbxListToCppSharedPtrList<LinphoneParticipantDeviceIdentity, + LinphonePrivate::ParticipantDeviceIdentity>(deviceIdentities); shared_ptr<ServerChatRoom> sgcr = dynamic_pointer_cast<ServerChatRoom>(AbstractChatRoom::toCpp(chat_room)->getSharedFromThis()); if (sgcr) diff --git a/src/c-wrapper/api/c-conference-info.cpp b/src/c-wrapper/api/c-conference-info.cpp index 0ecbe58d17847f30450d627d61f58425c16e6d1d..8d38aa8ff2886a26c31663f52b0d5070fe884058 100644 --- a/src/c-wrapper/api/c-conference-info.cpp +++ b/src/c-wrapper/api/c-conference-info.cpp @@ -87,7 +87,7 @@ void linphone_conference_info_set_participant_infos(LinphoneConferenceInfo *conf void linphone_conference_info_add_participant_infos(LinphoneConferenceInfo *conference_info, const bctbx_list_t *participant_infos) { const std::list<std::shared_ptr<LinphonePrivate::ParticipantInfo>> participantInfos = - ParticipantInfo::getCppListFromCList(participant_infos); + Utils::bctbxListToCppSharedPtrList<LinphoneParticipantInfo, ParticipantInfo>(participant_infos); ConferenceInfo::toCpp(conference_info)->addParticipants(participantInfos); } diff --git a/src/c-wrapper/api/c-conference.cpp b/src/c-wrapper/api/c-conference.cpp index f3fc8e13d26d3f5fc1df4c974e9f5b4dcb145bcd..15b6c5e258970101dded93a995193549c254c009 100644 --- a/src/c-wrapper/api/c-conference.cpp +++ b/src/c-wrapper/api/c-conference.cpp @@ -349,11 +349,8 @@ LinphoneStatus linphone_conference_invite_participants(LinphoneConference *confe const bctbx_list_t *addresses, const LinphoneCallParams *params) { ConferenceLogContextualizer logContextualizer(conference); - std::list<std::shared_ptr<const LinphonePrivate::Address>> addressList; - for (const bctbx_list_t *elem = addresses; elem != nullptr; elem = elem->next) { - const LinphoneAddress *data = static_cast<const LinphoneAddress *>(bctbx_list_get_data(elem)); - addressList.push_back(LinphonePrivate::Address::toCpp(data)->getSharedFromThis()); - } + std::list<std::shared_ptr<LinphonePrivate::Address>> addressList = + LinphonePrivate::Utils::bctbxListToCppSharedPtrList<LinphoneAddress, LinphonePrivate::Address>(addresses); return Conference::toCpp(conference)->inviteAddresses(addressList, params); } @@ -365,11 +362,8 @@ LinphoneStatus linphone_conference_add_participants(LinphoneConference *conferen LinphoneStatus linphone_conference_add_participants_2(LinphoneConference *conference, const bctbx_list_t *addresses) { ConferenceLogContextualizer logContextualizer(conference); - std::list<std::shared_ptr<const LinphonePrivate::Address>> addressList; - for (const bctbx_list_t *elem = addresses; elem != nullptr; elem = elem->next) { - const LinphoneAddress *data = static_cast<const LinphoneAddress *>(bctbx_list_get_data(elem)); - addressList.push_back(LinphonePrivate::Address::toCpp(data)->getSharedFromThis()); - } + std::list<std::shared_ptr<LinphonePrivate::Address>> addressList = + LinphonePrivate::Utils::bctbxListToCppSharedPtrList<LinphoneAddress, LinphonePrivate::Address>(addresses); return Conference::toCpp(conference)->addParticipants(addressList); } diff --git a/src/call/call-log.cpp b/src/call/call-log.cpp index 4ef7dcac3c076f241c3d67d42a0b099b26695fe0..7d059d20329019545aeedf79eb9a1236395e18ba 100644 --- a/src/call/call-log.cpp +++ b/src/call/call-log.cpp @@ -232,8 +232,7 @@ std::shared_ptr<ConferenceInfo> CallLog::getConferenceInfo() const { const std::shared_ptr<AbstractChatRoom> CallLog::getChatRoom() const { auto conferenceInfo = getConferenceInfo(); if (conferenceInfo && conferenceInfo->getCapability(LinphoneStreamTypeText)) { - return getCore()->getPrivate()->searchChatRoom(nullptr, nullptr, conferenceInfo->getUri(), - std::list<std::shared_ptr<const Address>>{}); + return getCore()->getPrivate()->searchChatRoom(nullptr, nullptr, conferenceInfo->getUri(), {}); } return nullptr; } diff --git a/src/chat/chat-room/abstract-chat-room.h b/src/chat/chat-room/abstract-chat-room.h index 710435b6ef0a7463e7ea21fa4826964850d8fa2a..2e762b32b21decdbf36993d4bb0dd6b1672df36b 100644 --- a/src/chat/chat-room/abstract-chat-room.h +++ b/src/chat/chat-room/abstract-chat-room.h @@ -204,7 +204,7 @@ public: virtual std::shared_ptr<Address> getConferenceAddress() const = 0; virtual std::shared_ptr<Participant> findParticipant(const std::shared_ptr<Address> &address) const = 0; virtual std::list<std::shared_ptr<Participant>> getParticipants() const = 0; - virtual std::list<std::shared_ptr<const Address>> getParticipantAddresses() const = 0; + virtual std::list<std::shared_ptr<Address>> getParticipantAddresses() const = 0; virtual bool canHandleParticipants() const = 0; virtual std::shared_ptr<Conference> getConference() const = 0; diff --git a/src/chat/chat-room/basic-chat-room.cpp b/src/chat/chat-room/basic-chat-room.cpp index f9f8b87f5f40e3f3f540d31bf832cf94ad177aa0..819abe5449f20b5ba29e924481cdfad7016f7975 100644 --- a/src/chat/chat-room/basic-chat-room.cpp +++ b/src/chat/chat-room/basic-chat-room.cpp @@ -154,8 +154,8 @@ std::list<std::shared_ptr<Participant>> BasicChatRoom::getParticipants() const { return mParticipants; } -std::list<std::shared_ptr<const Address>> BasicChatRoom::getParticipantAddresses() const { - list<std::shared_ptr<const Address>> addresses; +std::list<std::shared_ptr<Address>> BasicChatRoom::getParticipantAddresses() const { + list<std::shared_ptr<Address>> addresses; for (auto &participant : mParticipants) { addresses.push_back(participant->getAddress()); } diff --git a/src/chat/chat-room/basic-chat-room.h b/src/chat/chat-room/basic-chat-room.h index eaf752395ce4a09385a53a369edaba79bc9f951a..b94259b7d3bc2eecb14bd8361495c10ccd21825e 100644 --- a/src/chat/chat-room/basic-chat-room.h +++ b/src/chat/chat-room/basic-chat-room.h @@ -58,7 +58,7 @@ public: bool isMe(const std::shared_ptr<Address> &address) const override; std::shared_ptr<Participant> getMe() const override; std::list<std::shared_ptr<Participant>> getParticipants() const override; - std::list<std::shared_ptr<const Address>> getParticipantAddresses() const override; + std::list<std::shared_ptr<Address>> getParticipantAddresses() const override; protected: explicit BasicChatRoom(const std::shared_ptr<Core> &core, diff --git a/src/chat/chat-room/chat-room.cpp b/src/chat/chat-room/chat-room.cpp index 25aea7b5d32d31b3132f207567c3b8635ce64954..2a667361cb0f3ab335332a788dc459aa75749015 100644 --- a/src/chat/chat-room/chat-room.cpp +++ b/src/chat/chat-room/chat-room.cpp @@ -329,9 +329,7 @@ std::shared_ptr<AbstractChatRoom> ChatRoom::getImdnChatRoom(const std::shared_pt if (*peerAddress == chatRoomPeerAddress->getUriWithoutGruu()) { chatRoom = getSharedFromThis(); } else { - std::list<std::shared_ptr<const Address>> emptyList; - chatRoom = - getCore()->getPrivate()->searchChatRoom(getCurrentParams(), getLocalAddress(), peerAddress, emptyList); + chatRoom = getCore()->getPrivate()->searchChatRoom(getCurrentParams(), getLocalAddress(), peerAddress, {}); if (!chatRoom) { shared_ptr<ConferenceParams> params = ConferenceParams::create(getCore()); params->setChatDefaults(); @@ -1038,10 +1036,10 @@ std::list<std::shared_ptr<Participant>> ChatRoom::getParticipants() const { return conference->getParticipants(); } -std::list<std::shared_ptr<const Address>> ChatRoom::getParticipantAddresses() const { +std::list<std::shared_ptr<Address>> ChatRoom::getParticipantAddresses() const { const auto conference = getConference(); if (!conference) { - return std::list<std::shared_ptr<const Address>>(); + return {}; } return conference->getParticipantAddresses(); } diff --git a/src/chat/chat-room/chat-room.h b/src/chat/chat-room/chat-room.h index 98a237f9a44bf0ca3de5b156c59c1c7350ad7f76..e7d4c9bd1f043f2ac232d03d32750ed394ecfdfd 100644 --- a/src/chat/chat-room/chat-room.h +++ b/src/chat/chat-room/chat-room.h @@ -137,7 +137,7 @@ public: std::shared_ptr<Address> getConferenceAddress() const override; std::shared_ptr<Participant> findParticipant(const std::shared_ptr<Address> &address) const override; std::list<std::shared_ptr<Participant>> getParticipants() const override; - std::list<std::shared_ptr<const Address>> getParticipantAddresses() const override; + std::list<std::shared_ptr<Address>> getParticipantAddresses() const override; virtual std::shared_ptr<Conference> getConference() const override; diff --git a/src/conference/client-conference.cpp b/src/conference/client-conference.cpp index ba3ddf61a90a909858e27d4341e8da67d4bf932a..772d254e259aa6008e03f44d11c8ae412e7b4a7f 100644 --- a/src/conference/client-conference.cpp +++ b/src/conference/client-conference.cpp @@ -566,8 +566,7 @@ void ClientConference::callFocus() { Utils::toString(true)); linphone_call_params_enable_video(params, mConfParams->videoEnabled()); Conference::setUtf8Subject(mPendingSubject); - const std::list<std::shared_ptr<const Address>> addresses; - inviteAddresses(addresses, params); + inviteAddresses({}, params); linphone_call_params_unref(params); } } @@ -592,7 +591,7 @@ bool ClientConference::addParticipant(BCTBX_UNUSED(const std::shared_ptr<Partici return false; } -bool ClientConference::addParticipant(const std::shared_ptr<const Address> &participantAddress) { +bool ClientConference::addParticipant(const std::shared_ptr<Address> &participantAddress) { // Search call that matches participant session const std::list<std::shared_ptr<Call>> &coreCalls = getCore()->getCalls(); auto callIt = std::find_if(coreCalls.cbegin(), coreCalls.cend(), [&](const std::shared_ptr<Call> &c) { @@ -603,7 +602,7 @@ bool ClientConference::addParticipant(const std::shared_ptr<const Address> &part std::shared_ptr<Call> call = *callIt; ret = addParticipant(call); } else { - const list<std::shared_ptr<const Address>> addresses{participantAddress}; + const list<std::shared_ptr<Address>> addresses{participantAddress}; ret = addParticipants(addresses); } return ret; @@ -669,7 +668,7 @@ bool ClientConference::addParticipant(std::shared_ptr<Call> call) { // Removes own address and existing participants from the list. // Also removes gruu from kept addresses -std::list<Address> ClientConference::cleanAddressesList(const list<std::shared_ptr<const Address>> &addresses) const { +std::list<Address> ClientConference::cleanAddressesList(const list<std::shared_ptr<Address>> &addresses) const { std::list<Address> cleanedList; const auto &meAddress = getMe()->getAddress(); for (const auto &address : addresses) { @@ -705,7 +704,7 @@ bool ClientConference::addParticipants(const std::list<std::shared_ptr<Call>> &c return false; } -bool ClientConference::addParticipants(const list<std::shared_ptr<const Address>> &addresses) { +bool ClientConference::addParticipants(const list<std::shared_ptr<Address>> &addresses) { const auto isChat = mConfParams->chatEnabled(); if (getMe()->isAdmin() || ((mState == ConferenceInterface::State::Instantiated) && isChat)) { const auto mediaSupported = supportsMedia(); @@ -2009,7 +2008,7 @@ void ClientConference::notifyReceived(const std::shared_ptr<Event> ¬ifyLev, c #pragma GCC diagnostic pop #endif // _MSC_VER -int ClientConference::inviteAddresses(const std::list<std::shared_ptr<const Address>> &addresses, +int ClientConference::inviteAddresses(const std::list<std::shared_ptr<Address>> &addresses, const LinphoneCallParams *params) { const auto &account = mConfParams->getAccount(); const auto organizer = account ? account->getAccountParams()->getIdentityAddress() @@ -2045,7 +2044,7 @@ int ClientConference::inviteAddresses(const std::list<std::shared_ptr<const Addr return 0; } -bool ClientConference::dialOutAddresses(BCTBX_UNUSED(const std::list<std::shared_ptr<const Address>> &addressList)) { +bool ClientConference::dialOutAddresses(BCTBX_UNUSED(const std::list<std::shared_ptr<Address>> &addressList)) { lError() << *this << ": ClientConference::dialOutAddresses() not implemented"; return false; } @@ -2551,7 +2550,7 @@ void ClientConference::onCallSessionSetTerminated(const shared_ptr<CallSession> getCore()->removeConferencePendingCreation(ref); if (remoteAddress == nullptr) { lError() << *this - << " The session to update the conference information did not succesfully establish hence it is " + << " The session to update the conference information did not successfully establish hence it is " "likely that the request wasn't taken into account by the server"; setState(ConferenceInterface::State::CreationFailed); } else if (dynamic_pointer_cast<MediaSession>(session) && @@ -2560,7 +2559,7 @@ void ClientConference::onCallSessionSetTerminated(const shared_ptr<CallSession> (session->getParams()->getPrivate()->getStartTime() < 0)) { auto conferenceAddress = remoteAddress; - lInfo() << *this << " has been succesfully created: " << *conferenceAddress; + lInfo() << *this << " has been successfully created: " << *conferenceAddress; const auto &meAddress = getMe()->getAddress(); ConferenceId conferenceId(conferenceAddress, meAddress, getCore()->createConferenceIdParams()); // Do not change the conference ID yet if exhuming a chatroom diff --git a/src/conference/client-conference.h b/src/conference/client-conference.h index a8f1777060339b0b059511673cc4eeb2a47b3fee..ac99512a6d4fd20658324389b711d4b31c2ad9c4 100644 --- a/src/conference/client-conference.h +++ b/src/conference/client-conference.h @@ -52,14 +52,14 @@ public: const std::shared_ptr<CallSession> &focusSession, SalCallOp *op = nullptr, ConferenceListener *confListener = nullptr); - virtual int inviteAddresses(const std::list<std::shared_ptr<const Address>> &addresses, + virtual int inviteAddresses(const std::list<std::shared_ptr<Address>> &addresses, const LinphoneCallParams *params) override; - virtual bool dialOutAddresses(const std::list<std::shared_ptr<const Address>> &addressList) override; + virtual bool dialOutAddresses(const std::list<std::shared_ptr<Address>> &addressList) override; virtual bool addParticipant(const std::shared_ptr<ParticipantInfo> &info) override; virtual bool addParticipants(const std::list<std::shared_ptr<Call>> &call) override; - virtual bool addParticipants(const std::list<std::shared_ptr<const Address>> &addresses) override; + virtual bool addParticipants(const std::list<std::shared_ptr<Address>> &addresses) override; virtual bool addParticipant(std::shared_ptr<Call> call) override; - virtual bool addParticipant(const std::shared_ptr<const Address> &participantAddress) override; + virtual bool addParticipant(const std::shared_ptr<Address> &participantAddress) override; virtual std::shared_ptr<ParticipantDevice> createParticipantDevice(std::shared_ptr<Participant> participant, std::shared_ptr<Call> call) override; virtual bool finalizeParticipantAddition(std::shared_ptr<Call> call) override; @@ -211,7 +211,7 @@ private: void onFocusCallStateChanged(CallSession::State state, const std::string &message); void onPendingCallStateChanged(std::shared_ptr<Call> call, CallSession::State callState); - std::list<Address> cleanAddressesList(const std::list<std::shared_ptr<const Address>> &addresses) const; + std::list<Address> cleanAddressesList(const std::list<std::shared_ptr<Address>> &addresses) const; virtual void configure(SalCallOp *op) override; diff --git a/src/conference/conference-context.cpp b/src/conference/conference-context.cpp index b271549a697468b6edbefce79392a23118d1c6c8..8d8e289b9c8a15375da8214a820d555df4d9c079 100644 --- a/src/conference/conference-context.cpp +++ b/src/conference/conference-context.cpp @@ -28,7 +28,7 @@ LINPHONE_BEGIN_NAMESPACE ConferenceContext::ConferenceContext(const std::shared_ptr<ConferenceParams> ¶ms, const std::shared_ptr<const Address> &localAddress, const std::shared_ptr<const Address> &remoteAddress, - const std::list<std::shared_ptr<const Address>> &participants) { + const std::list<std::shared_ptr<Address>> &participants) { mParams = params; mParticipants = participants; mLocalAddress = (localAddress) ? localAddress->getUriWithoutGruu() : Address(); diff --git a/src/conference/conference-context.h b/src/conference/conference-context.h index 7988e7e2a821efa99292b4dab60efd4a585fb882..72fa3825a6bf27e6b2bc696b844c49a52c5f03ee 100644 --- a/src/conference/conference-context.h +++ b/src/conference/conference-context.h @@ -37,7 +37,7 @@ public: ConferenceContext(const std::shared_ptr<ConferenceParams> ¶ms, const std::shared_ptr<const Address> &localAddress, const std::shared_ptr<const Address> &remoteAddress, - const std::list<std::shared_ptr<const Address>> &participants); + const std::list<std::shared_ptr<Address>> &participants); ConferenceContext(ConferenceContext &&other) = delete; ConferenceContext(const ConferenceContext &other) = delete; virtual ~ConferenceContext() = default; @@ -45,7 +45,7 @@ public: inline const std::shared_ptr<const ConferenceParams> getParams() const { return mParams; } - inline const std::list<std::shared_ptr<const Address>> &getParticipants() const { + inline const std::list<std::shared_ptr<Address>> &getParticipants() const { return mParticipants; } inline const Address &getLocalAddress() const { @@ -59,7 +59,7 @@ public: private: std::shared_ptr<const ConferenceParams> mParams; - std::list<std::shared_ptr<const Address>> mParticipants; + std::list<std::shared_ptr<Address>> mParticipants; Address mLocalAddress; Address mRemoteAddress; }; diff --git a/src/conference/conference-interface.h b/src/conference/conference-interface.h index 363c032816399b30599f742e14dae9fbc106614a..633fab20e96b0a1b605ec615fc3240d9dbefdafe 100644 --- a/src/conference/conference-interface.h +++ b/src/conference/conference-interface.h @@ -148,7 +148,7 @@ public: <br> @param[in] participantAddress The address of the participant to add to this Conference. */ - virtual bool addParticipant(const std::shared_ptr<const Address> &participantAddress) = 0; + virtual bool addParticipant(const std::shared_ptr<Address> &participantAddress) = 0; /* * Same as function addParticipant(const std::shared_ptr<Address> &participantAddress), except that call to add is @@ -171,7 +171,7 @@ public: * @param[in] addresses * @return True if everything is OK, False otherwise */ - virtual bool addParticipants(const std::list<std::shared_ptr<const Address>> &addresses) = 0; + virtual bool addParticipants(const std::list<std::shared_ptr<Address>> &addresses) = 0; /* * Add local participant to this conference, this fonction is only available for local focus. Behavior is the same diff --git a/src/conference/conference-scheduler.cpp b/src/conference/conference-scheduler.cpp index 173563291b6c298e438a281ba731986419c354c5..cd3587b108351ccf6b6b7cbd3717b0e258dd77aa 100644 --- a/src/conference/conference-scheduler.cpp +++ b/src/conference/conference-scheduler.cpp @@ -279,13 +279,13 @@ void ConferenceScheduler::setConferenceAddress(const std::shared_ptr<Address> &c if (getState() == State::AllocationPending) { lInfo() << "[Conference Scheduler] [" << this - << "] Conference has been succesfully created: " << *conferenceAddress; + << "] Conference has been successfully created: " << *conferenceAddress; mConferenceInfo->setUri(conferenceAddress); } else { const auto &uri = mConferenceInfo->getUri(); // No need to update the conference address during an update lInfo() << "[Conference Scheduler] [" << this - << "] Conference has been succesfully updated: " << (uri ? uri->toString() : std::string("sip:")); + << "] Conference has been successfully updated: " << (uri ? uri->toString() : std::string("sip:")); } bool error = false; @@ -470,9 +470,9 @@ void ConferenceScheduler::sendInvitations(shared_ptr<ConferenceParams> conferenc // Sending the ICS once for each participant in a separated chat room each time. for (auto participant : mInvitationsToSend) { - list<std::shared_ptr<const Address>> chatRoomParticipantList; + list<std::shared_ptr<Address>> chatRoomParticipantList; chatRoomParticipantList.push_back(participant); - list<std::shared_ptr<const Address>> participantList; + list<std::shared_ptr<Address>> participantList; std::shared_ptr<Address> remoteAddress = nullptr; if (conferenceParams->getChatParams()->getBackend() == LinphonePrivate::ChatParams::Backend::FlexisipChat) { participantList.push_back(participant); diff --git a/src/conference/conference.cpp b/src/conference/conference.cpp index 7e17b160266108c51b20abdcf759e11906288641..195f1810ce594e9b39aeaabeeaf38819cf9ccfa9 100644 --- a/src/conference/conference.cpp +++ b/src/conference/conference.cpp @@ -348,7 +348,7 @@ bool Conference::addParticipant(std::shared_ptr<Call> call) { return success; } -bool Conference::addParticipant(const std::shared_ptr<const Address> &participantAddress) { +bool Conference::addParticipant(const std::shared_ptr<Address> &participantAddress) { shared_ptr<Participant> participant = findParticipant(participantAddress); if (participant) { lWarning() << "Not adding participant '" << *participantAddress << "' because it is already a participant of " @@ -369,8 +369,8 @@ std::shared_ptr<CallSession> Conference::getMainSession() const { return mMe->getSession(); } -bool Conference::addParticipants(const std::list<std::shared_ptr<const Address>> &addresses) { - list<std::shared_ptr<const Address>> sortedAddresses(addresses); +bool Conference::addParticipants(const std::list<std::shared_ptr<Address>> &addresses) { + list<std::shared_ptr<Address>> sortedAddresses(addresses); sortedAddresses.sort([](const auto &addr1, const auto &addr2) { return *addr1 < *addr2; }); sortedAddresses.unique([](const auto &addr1, const auto &addr2) { return addr1->weakEqual(*addr2); }); @@ -741,8 +741,8 @@ const list<shared_ptr<Participant>> &Conference::getParticipants() const { return mParticipants; } -std::list<std::shared_ptr<const Address>> Conference::getParticipantAddresses() const { - list<std::shared_ptr<const Address>> addresses; +std::list<std::shared_ptr<Address>> Conference::getParticipantAddresses() const { + list<std::shared_ptr<Address>> addresses; for (auto &participant : mParticipants) { addresses.push_back(participant->getAddress()); } diff --git a/src/conference/conference.h b/src/conference/conference.h index 59f694934a3862872921c9b9c5f90c02a3f2549a..d474bbeeb0b62d0ec7afd4799d5f81ad44b6e9db 100644 --- a/src/conference/conference.h +++ b/src/conference/conference.h @@ -80,9 +80,9 @@ public: virtual ~Conference(); - virtual int inviteAddresses(const std::list<std::shared_ptr<const Address>> &addresses, + virtual int inviteAddresses(const std::list<std::shared_ptr<Address>> &addresses, const LinphoneCallParams *params) = 0; - virtual bool dialOutAddresses(const std::list<std::shared_ptr<const Address>> &addressList) = 0; + virtual bool dialOutAddresses(const std::list<std::shared_ptr<Address>> &addressList) = 0; virtual bool finalizeParticipantAddition(std::shared_ptr<Call> call) = 0; std::shared_ptr<Participant> getActiveParticipant() const; @@ -114,15 +114,15 @@ public: void addInvitedParticipant(const std::shared_ptr<Participant> &participant); bool addParticipant(std::shared_ptr<Call> call) override; bool addParticipant(const std::shared_ptr<ParticipantInfo> &info) override; - bool addParticipant(const std::shared_ptr<const Address> &participantAddress) override; - bool addParticipants(const std::list<std::shared_ptr<const Address>> &addresses) override; + bool addParticipant(const std::shared_ptr<Address> &participantAddress) override; + bool addParticipants(const std::list<std::shared_ptr<Address>> &addresses) override; virtual bool addParticipantDevice(std::shared_ptr<Call> call); virtual void addParticipantDevice(const std::shared_ptr<Participant> &participant, const std::shared_ptr<ParticipantDeviceIdentity> &deviceInfo); int getParticipantCount() const override; const std::list<std::shared_ptr<Participant>> &getParticipants() const override; - std::list<std::shared_ptr<const Address>> getParticipantAddresses() const; + std::list<std::shared_ptr<Address>> getParticipantAddresses() const; std::list<std::shared_ptr<ParticipantDevice>> getParticipantDevices(bool includeMe = true) const override; std::shared_ptr<Participant> getScreenSharingParticipant() const; std::shared_ptr<ParticipantDevice> getScreenSharingDevice() const; diff --git a/src/conference/server-conference.cpp b/src/conference/server-conference.cpp index 5d985b0b247ff8f378d127f982c4cb012c24150c..68489914b704a2c69bc452cd24e501f083bd9328 100644 --- a/src/conference/server-conference.cpp +++ b/src/conference/server-conference.cpp @@ -1240,7 +1240,7 @@ shared_ptr<ConferenceAvailableMediaEvent> ServerConference::notifyAvailableMedia return Conference::notifyAvailableMediaChanged(creationTime, isFullState, mediaCapabilities); } -int ServerConference::inviteAddresses(const list<std::shared_ptr<const Address>> &addresses, +int ServerConference::inviteAddresses(const std::list<std::shared_ptr<Address>> &addresses, const LinphoneCallParams *params) { const auto &coreCurrentCall = getCore()->getCurrentCall(); @@ -1385,7 +1385,7 @@ int ServerConference::inviteAddresses(const list<std::shared_ptr<const Address>> return 0; } -bool ServerConference::dialOutAddresses(const std::list<std::shared_ptr<const Address>> &addressList) { +bool ServerConference::dialOutAddresses(const std::list<std::shared_ptr<Address>> &addressList) { auto new_params = linphone_core_create_call_params(getCore()->getCCore(), nullptr); linphone_call_params_enable_audio(new_params, mConfParams->audioEnabled()); linphone_call_params_enable_video(new_params, mConfParams->videoEnabled()); @@ -1763,7 +1763,7 @@ bool ServerConference::addParticipants(const std::list<std::shared_ptr<Call>> &c return success; } -bool ServerConference::addParticipants(const std::list<std::shared_ptr<const Address>> &addresses) { +bool ServerConference::addParticipants(const std::list<std::shared_ptr<Address>> &addresses) { return Conference::addParticipants(addresses); } @@ -2017,7 +2017,7 @@ bool ServerConference::addParticipant(std::shared_ptr<Call> call) { // If no resource list is provided in the INVITE, there is not need to call participants if ((initialState == ConferenceInterface::State::CreationPending) && dialout && !isEmpty) { - list<std::shared_ptr<const Address>> addresses; + std::list<std::shared_ptr<Address>> addresses; for (auto &participant : mInvitedParticipants) { const auto &addr = participant->getAddress(); // Do not invite organizer as it is already dialing in @@ -2035,7 +2035,7 @@ bool ServerConference::addParticipant(std::shared_ptr<Call> call) { return false; } -bool ServerConference::addParticipant(const std::shared_ptr<const Address> &participantAddress) { +bool ServerConference::addParticipant(const std::shared_ptr<Address> &participantAddress) { auto participantInfo = Factory::get()->createParticipantInfo(participantAddress); // Participants invited after the start of a conference through the address can only listen to it participantInfo->setRole(Participant::Role::Listener); @@ -2061,7 +2061,7 @@ bool ServerConference::addParticipant(const std::shared_ptr<ParticipantInfo> &in mInvitedParticipants.push_back(participant); } - std::list<std::shared_ptr<const Address>> addressesList{participantAddress}; + std::list<std::shared_ptr<Address>> addressesList{participantAddress}; return dialOutAddresses(addressesList); } } else { diff --git a/src/conference/server-conference.h b/src/conference/server-conference.h index 611252d5bea6ff312c8de196b6ad4a15bf8cd5d3..01587ac409e7e95f36dee940275e72165bf59a16 100644 --- a/src/conference/server-conference.h +++ b/src/conference/server-conference.h @@ -52,9 +52,9 @@ public: const std::shared_ptr<ConferenceParams> params); virtual ~ServerConference(); - virtual int inviteAddresses(const std::list<std::shared_ptr<const Address>> &addresses, + virtual int inviteAddresses(const std::list<std::shared_ptr<Address>> &addresses, const LinphoneCallParams *params) override; - virtual bool dialOutAddresses(const std::list<std::shared_ptr<const Address>> &addressList) override; + virtual bool dialOutAddresses(const std::list<std::shared_ptr<Address>> &addressList) override; void inviteDevice(const std::shared_ptr<ParticipantDevice> &device); void byeDevice(const std::shared_ptr<ParticipantDevice> &device); @@ -64,10 +64,10 @@ public: int getParticipantCount() const override; virtual bool addParticipants(const std::list<std::shared_ptr<Call>> &call) override; - virtual bool addParticipants(const std::list<std::shared_ptr<const Address>> &addresses) override; + virtual bool addParticipants(const std::list<std::shared_ptr<Address>> &addresses) override; virtual bool addParticipant(std::shared_ptr<Call> call) override; virtual bool addParticipant(const std::shared_ptr<ParticipantInfo> &info) override; - virtual bool addParticipant(const std::shared_ptr<const Address> &participantAddress) override; + virtual bool addParticipant(const std::shared_ptr<Address> &participantAddress) override; virtual bool finalizeParticipantAddition(std::shared_ptr<Call> call) override; virtual std::shared_ptr<ParticipantDevice> createParticipantDevice(std::shared_ptr<Participant> participant, std::shared_ptr<Call> call) override; diff --git a/src/conference/session/call-session.cpp b/src/conference/session/call-session.cpp index 93b4c98e932e4529071ad89819a45e66f99d063d..df44d285d06ed6d470be98c202361f2c774b02b3 100644 --- a/src/conference/session/call-session.cpp +++ b/src/conference/session/call-session.cpp @@ -1067,8 +1067,7 @@ bool CallSessionPrivate::reportEvents() const { const auto clientConferenceGuessedAddress = (remoteContactAddress && remoteContactAddress->hasUriParam("conf-id")) ? remoteContactAddress : remoteAddress; const auto &peerAddress = isInConference() ? serverConferenceGuessedAddress : clientConferenceGuessedAddress; - const auto conference = - q->getCore()->searchConference(nullptr, nullptr, peerAddress, std::list<std::shared_ptr<const Address>>()); + const auto conference = q->getCore()->searchConference(nullptr, nullptr, peerAddress, {}); ConferenceInterface::State conferenceState = (conference) ? conference->getState() : ConferenceInterface::State::Instantiated; bool conferenceCreated = !((conferenceState == ConferenceInterface::State::Instantiated) || diff --git a/src/conference/session/media-session.cpp b/src/conference/session/media-session.cpp index 97f1fed05197476ed9597cf952529a18982a072d..4d61e5337051412e4120f6bfa429e4c8bce93419 100644 --- a/src/conference/session/media-session.cpp +++ b/src/conference/session/media-session.cpp @@ -4778,8 +4778,8 @@ void MediaSession::sendVfuRequest() { } else lInfo() << "vfu request using sip disabled from config [sip,vfu_with_info]"; } -// Try to search the local conference by first looking at the contact address and if it is unsuccesfull to the to -// address as a client may try to be calling a conference URI directly Typically, the seach using the contact address +// Try to search the local conference by first looking at the contact address and if it is unsuccessfull to the to +// address as a client may try to be calling a conference URI directly Typically, the search using the contact address // will succeed when a client creates a conference. const std::shared_ptr<Conference> MediaSession::getLocalConference() const { L_D(); diff --git a/src/conference/sip-conference-scheduler.cpp b/src/conference/sip-conference-scheduler.cpp index 7a55320020d865aa8582ae023c8da170b504a8eb..354149ba8344fe749e3c155f334ecdda1b916835 100644 --- a/src/conference/sip-conference-scheduler.cpp +++ b/src/conference/sip-conference-scheduler.cpp @@ -97,7 +97,7 @@ void SIPConferenceScheduler::onCallSessionSetTerminated(const std::shared_ptr<Ca << "] The session to update the conference information of conference " << (conferenceAddress && conferenceAddress->isValid() ? conferenceAddress->toString() : std::string("sip:")) - << " did not succesfully establish hence it is likely that the request wasn't taken into account by " + << " did not successfully establish hence it is likely that the request wasn't taken into account by " "the server"; setState(State::Error); } else if (getState() != State::Error) { diff --git a/src/core/core-chat-room.cpp b/src/core/core-chat-room.cpp index bda1547a9ae337dfbef4fae9d8b52bb93227d06e..769eed7b5d3f4ae2101d7b6419abbc266ea34fc8 100644 --- a/src/core/core-chat-room.cpp +++ b/src/core/core-chat-room.cpp @@ -276,7 +276,7 @@ std::shared_ptr<AbstractChatRoom> CorePrivate::searchChatRoom(const std::shared_ptr<ConferenceParams> ¶ms, const std::shared_ptr<const Address> &localAddress, const std::shared_ptr<const Address> &remoteAddress, - const std::list<std::shared_ptr<const Address>> &participants) const { + const std::list<std::shared_ptr<Address>> &participants) const { L_Q(); ConferenceContext referenceConferenceContext(params, localAddress, remoteAddress, participants); const auto &chatRooms = q->getRawChatRoomList(); @@ -298,13 +298,12 @@ std::shared_ptr<AbstractChatRoom> CorePrivate::searchChatRoom(const std::string if (!localAddress || !localAddress->isValid() || !peerAddress || !peerAddress->isValid()) { return nullptr; } - return searchChatRoom(nullptr, localAddress, peerAddress, std::list<std::shared_ptr<Address>>()); + return searchChatRoom(nullptr, localAddress, peerAddress, {}); } -shared_ptr<AbstractChatRoom> -CorePrivate::createChatRoom(const shared_ptr<ConferenceParams> ¶ms, - const std::shared_ptr<const Address> &localAddr, - const std::list<std::shared_ptr<const Address>> &participants) { +shared_ptr<AbstractChatRoom> CorePrivate::createChatRoom(const shared_ptr<ConferenceParams> ¶ms, + const std::shared_ptr<const Address> &localAddr, + const std::list<std::shared_ptr<Address>> &participants) { L_Q(); if (!params) { lWarning() << "Trying to create chat room with null parameters"; @@ -323,12 +322,7 @@ CorePrivate::createChatRoom(const shared_ptr<ConferenceParams> ¶ms, lWarning() << "Tying to create chat room with unavailable backend"; return nullptr; } - shared_ptr<AbstractChatRoom> chatRoom = searchChatRoom(params, localAddr, nullptr, participants); - if (chatRoom != nullptr) { - lWarning() << "Found already existing chat room that matches the given parameters, using this one " - << *chatRoom; - return chatRoom; - } + shared_ptr<AbstractChatRoom> chatRoom; if (params->getChatParams()->getBackend() == ChatParams::Backend::FlexisipChat) { #ifdef HAVE_ADVANCED_IM @@ -339,6 +333,15 @@ CorePrivate::createChatRoom(const shared_ptr<ConferenceParams> ¶ms, return nullptr; } + if (!params->isGroup() && participants.size() > 0) { + chatRoom = searchChatRoom(params, localAddr, nullptr, participants); + if (chatRoom) { + lWarning() << "Found already existing 1-1 chat room that matches the given parameters, using this one " + << *chatRoom; + return chatRoom; + } + } + ConferenceId conferenceId = ConferenceId(nullptr, localAddr, q->createConferenceIdParams()); chatRoom = createClientChatRoom(conferenceFactoryUri, conferenceId, nullptr, params); @@ -362,23 +365,28 @@ CorePrivate::createChatRoom(const shared_ptr<ConferenceParams> ¶ms, } std::shared_ptr<const Address> remoteAddr = participants.front(); - chatRoom = createBasicChatRoom(ConferenceId(remoteAddr, localAddr, q->createConferenceIdParams()), params); - insertChatRoom(chatRoom); - insertChatRoomWithDb(chatRoom); + chatRoom = searchChatRoom(params, localAddr, remoteAddr, {}); + if (chatRoom == nullptr) { + std::shared_ptr<const Address> remoteAddr = participants.front(); + chatRoom = createBasicChatRoom(ConferenceId(remoteAddr, localAddr, q->createConferenceIdParams()), params); + insertChatRoom(chatRoom); + insertChatRoomWithDb(chatRoom); + } else { + lInfo() << "Found an existing BasicChatRoom with this participant, using it instead of creating a new one"; + } } return chatRoom; } -shared_ptr<AbstractChatRoom> -CorePrivate::createChatRoom(const shared_ptr<ConferenceParams> ¶ms, - const std::list<std::shared_ptr<const Address>> &participants) { +shared_ptr<AbstractChatRoom> CorePrivate::createChatRoom(const shared_ptr<ConferenceParams> ¶ms, + const std::list<std::shared_ptr<Address>> &participants) { auto defaultLocalAddress = getDefaultLocalAddress(nullptr, params->getChatParams()->getBackend() == ChatParams::Backend::FlexisipChat); return createChatRoom(params, defaultLocalAddress, participants); } -shared_ptr<AbstractChatRoom> -CorePrivate::createChatRoom(const std::string &subject, const std::list<std::shared_ptr<const Address>> &participants) { +shared_ptr<AbstractChatRoom> CorePrivate::createChatRoom(const std::string &subject, + const std::list<std::shared_ptr<Address>> &participants) { L_Q(); shared_ptr<ConferenceParams> params = ConferenceParams::create(q->getSharedFromThis()); @@ -397,13 +405,13 @@ CorePrivate::createChatRoom(const std::string &subject, const std::list<std::sha shared_ptr<AbstractChatRoom> CorePrivate::createChatRoom(const shared_ptr<ConferenceParams> ¶ms, const std::shared_ptr<Address> &localAddr, - const std::shared_ptr<const Address> &participant) { - const std::list<std::shared_ptr<const Address>> &participants{participant}; + const std::shared_ptr<Address> &participant) { + const std::list<std::shared_ptr<Address>> &participants{participant}; return createChatRoom(params, localAddr, participants); } // Assume basic chat room creation -shared_ptr<AbstractChatRoom> CorePrivate::createChatRoom(const std::shared_ptr<const Address> &participant) { +shared_ptr<AbstractChatRoom> CorePrivate::createChatRoom(const std::shared_ptr<Address> &participant) { return createChatRoom("", {participant}); } @@ -750,9 +758,7 @@ const bctbx_list_t *Core::getChatRoomsCList() const { shared_ptr<AbstractChatRoom> Core::findChatRoom(const ConferenceId &conferenceId, bool logIfNotFound) const { L_D(); - std::list<std::shared_ptr<const Address>> emptyList; - auto chatRoom = - d->searchChatRoom(nullptr, conferenceId.getLocalAddress(), conferenceId.getPeerAddress(), emptyList); + auto chatRoom = d->searchChatRoom(nullptr, conferenceId.getLocalAddress(), conferenceId.getPeerAddress(), {}); if (chatRoom) { lDebug() << "Found chat room in RAM for conference ID " << conferenceId << "."; return chatRoom; @@ -783,9 +789,8 @@ shared_ptr<AbstractChatRoom> Core::getOrCreateBasicChatRoom(const ConferenceId & L_D(); ChatRoom::CapabilitiesMask capabilities({ChatRoom::Capabilities::Basic, ChatRoom::Capabilities::OneToOne}); auto params = ConferenceParams::fromCapabilities(capabilities, getSharedFromThis()); - std::list<std::shared_ptr<const Address>> emptyList; shared_ptr<AbstractChatRoom> chatRoom = - d->searchChatRoom(params, conferenceId.getLocalAddress(), conferenceId.getPeerAddress(), emptyList); + d->searchChatRoom(params, conferenceId.getLocalAddress(), conferenceId.getPeerAddress(), {}); if (chatRoom) { return chatRoom; } diff --git a/src/core/core-p.h b/src/core/core-p.h index fe5a3eb53f4f8f4f52ecc5db1f979dd6d24a7801..85f474e50fbee40f6bff5f42be9dd4c786d6c366 100644 --- a/src/core/core-p.h +++ b/src/core/core-p.h @@ -133,15 +133,15 @@ public: std::shared_ptr<AbstractChatRoom> createChatRoom(const std::shared_ptr<ConferenceParams> ¶ms, const std::shared_ptr<const Address> &localAddr, - const std::list<std::shared_ptr<const Address>> &participants); + const std::list<std::shared_ptr<Address>> &participants); std::shared_ptr<AbstractChatRoom> createChatRoom(const std::shared_ptr<ConferenceParams> ¶ms, - const std::list<std::shared_ptr<const Address>> &participants); + const std::list<std::shared_ptr<Address>> &participants); std::shared_ptr<AbstractChatRoom> createChatRoom(const std::string &subject, - const std::list<std::shared_ptr<const Address>> &participants); + const std::list<std::shared_ptr<Address>> &participants); std::shared_ptr<AbstractChatRoom> createChatRoom(const std::shared_ptr<ConferenceParams> ¶ms, const std::shared_ptr<Address> &localAddr, - const std::shared_ptr<const Address> &participant); - std::shared_ptr<AbstractChatRoom> createChatRoom(const std::shared_ptr<const Address> &participant); + const std::shared_ptr<Address> &participant); + std::shared_ptr<AbstractChatRoom> createChatRoom(const std::shared_ptr<Address> &participant); std::shared_ptr<AbstractChatRoom> searchChatRoom(const std::string identifier) const; std::shared_ptr<AbstractChatRoom> searchChatRoom(const std::shared_ptr<ConferenceParams> ¶ms, diff --git a/src/core/core.cpp b/src/core/core.cpp index 38aac92a22f32f3f974621b6d1f54788bd77b874..57b3bd0ac1512b9d16b14684e983631dee28f516 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp @@ -347,7 +347,7 @@ void CorePrivate::deleteConferenceInfo(const std::shared_ptr<Address> &conferenc #ifdef HAVE_DB_STORAGE mainDb->deleteConferenceInfo(conferenceAddress); #endif // HAVE_DB_STORAGE - auto chatRoom = searchChatRoom(nullptr, nullptr, conferenceAddress, std::list<std::shared_ptr<const Address>>()); + auto chatRoom = searchChatRoom(nullptr, nullptr, conferenceAddress, {}); if (chatRoom) { chatRoom->deleteFromDb(); } @@ -1976,11 +1976,10 @@ void Core::deleteConference(const shared_ptr<const Conference> &conference) { deleteConference(conferenceId); } -std::shared_ptr<Conference> -Core::searchConference(const std::shared_ptr<ConferenceParams> ¶ms, - const std::shared_ptr<const Address> &localAddress, - const std::shared_ptr<const Address> &remoteAddress, - const std::list<std::shared_ptr<const Address>> &participants) const { +std::shared_ptr<Conference> Core::searchConference(const std::shared_ptr<ConferenceParams> ¶ms, + const std::shared_ptr<const Address> &localAddress, + const std::shared_ptr<const Address> &remoteAddress, + const std::list<std::shared_ptr<Address>> &participants) const { L_D(); ConferenceContext referenceConferenceContext(params, localAddress, remoteAddress, participants); const auto it = std::find_if( diff --git a/src/core/core.h b/src/core/core.h index 15f7f41267a47e8328bd91090ee79e4882ccbd75..1063ad5feb8e3e0deb3f1f6e3d5f370100f146a6 100644 --- a/src/core/core.h +++ b/src/core/core.h @@ -252,7 +252,7 @@ public: std::shared_ptr<Conference> searchConference(const std::shared_ptr<ConferenceParams> ¶ms, const std::shared_ptr<const Address> &localAddress, const std::shared_ptr<const Address> &remoteAddress, - const std::list<std::shared_ptr<const Address>> &participants) const; + const std::list<std::shared_ptr<Address>> &participants) const; std::shared_ptr<Conference> searchConference(const std::shared_ptr<const Address> &conferenceAddress) const; std::shared_ptr<Conference> searchConference(const std::string identifier) const; diff --git a/src/nat/ice-service.h b/src/nat/ice-service.h index 95b034692a3235c95ffe75389a68681527ff1da8..a97d4fd508265fee0d69f5db452f5bf5a3de9c06 100644 --- a/src/nat/ice-service.h +++ b/src/nat/ice-service.h @@ -40,7 +40,7 @@ public: bool isActive() const; - /* Returns true if ICE has completed succesfully. */ + /* Returns true if ICE has completed successfully. */ bool hasCompleted() const; /* Returns true if ICE is running. */ diff --git a/tester/audio_bypass_tester.c b/tester/audio_bypass_tester.c index 74b0ff7eddd69742c642462923926669311ce451..3e882dbe7272ea2548122067a1abe2b947a15fdb 100644 --- a/tester/audio_bypass_tester.c +++ b/tester/audio_bypass_tester.c @@ -428,7 +428,7 @@ static void only_enable_payload(LinphoneCore *lc, const char *mime, int rate, in /* * set some conservative jitter buffer params to be more robust to late ticks. - * This is important so that the audio comparison is succesful*/ + * This is important so that the audio comparison is successful*/ static void set_jitter_buffer_params(LinphoneCore *lc) { int jitter_buffer_ms = 300; linphone_config_set_int(linphone_core_get_config(lc), "rtp", "jitter_buffer_min_size", jitter_buffer_ms); diff --git a/tester/call_single_tester.c b/tester/call_single_tester.c index df4be7a389f1b87ee323f4260a7a8034378a2d4e..c9746f9588ead89b675e5dd5cd714b2870a62bbd 100644 --- a/tester/call_single_tester.c +++ b/tester/call_single_tester.c @@ -5862,7 +5862,7 @@ static void call_state_changed_3(BCTBX_UNUSED(LinphoneCore *lc), ms_free(from); } -static void call_with_transport_change_base(bool_t succesfull_call) { +static void call_with_transport_change_base(bool_t successfull_call) { LinphoneSipTransports sip_tr; LinphoneCoreManager *marie; LinphoneCoreManager *pauline; @@ -5896,14 +5896,14 @@ static void call_with_transport_change_base(bool_t succesfull_call) { } } - if (succesfull_call) { + if (successfull_call) { BC_ASSERT_TRUE(call(marie, pauline)); end_call(marie, pauline); } else linphone_core_invite(marie->lc, "nexiste_pas"); - if (succesfull_call) BC_ASSERT_TRUE(wait_for(marie->lc, pauline->lc, &marie->stat.number_of_LinphoneCallEnd, 1)); + if (successfull_call) BC_ASSERT_TRUE(wait_for(marie->lc, pauline->lc, &marie->stat.number_of_LinphoneCallEnd, 1)); BC_ASSERT_TRUE(wait_for(marie->lc, pauline->lc, &marie->stat.number_of_LinphoneCallReleased, 1)); - if (succesfull_call) { + if (successfull_call) { BC_ASSERT_TRUE(wait_for(marie->lc, pauline->lc, &pauline->stat.number_of_LinphoneCallEnd, 1)); BC_ASSERT_TRUE(wait_for(marie->lc, pauline->lc, &pauline->stat.number_of_LinphoneCallReleased, 1)); } diff --git a/tester/call_video_tester.cpp b/tester/call_video_tester.cpp index 4e43e911fedc4c331e5ad4f5a0c1bbedda946ebd..2a96caeeb2e21645b339dcbd78b180cced56647c 100644 --- a/tester/call_video_tester.cpp +++ b/tester/call_video_tester.cpp @@ -356,10 +356,10 @@ _request_video(LinphoneCoreManager *caller, LinphoneCoreManager *callee, bool_t } /* - * This function requests the addon of a video stream, initiated by "callee" and potentiall accepted by "caller", + * This function requests the addon of a video stream, initiated by "callee" and potentially accepted by "caller", * and asserts a number of things after this is done. * However the video addon may fail due to video policy, so that there is no insurance that video is actually added. - * This function returns TRUE if video was succesfully added, FALSE otherwise or if video is already there. + * This function returns TRUE if video was successfully added, FALSE otherwise or if video is already there. **/ bool_t request_video(LinphoneCoreManager *caller, LinphoneCoreManager *callee, bool_t accept_with_params) { stats initial_caller_stat = caller->stat; diff --git a/tester/conference-event-tester.cpp b/tester/conference-event-tester.cpp index 0d806d9c3141f0ebf1962079e21a2897835ee7d9..7a558d5bebd9b31bd1d6e2f780fc0bfabd73b26b 100644 --- a/tester/conference-event-tester.cpp +++ b/tester/conference-event-tester.cpp @@ -880,7 +880,7 @@ public: // Addressing compilation error -Werror=overloaded-virtual using LinphonePrivate::Conference::addParticipant; - bool addParticipant(const std::shared_ptr<const Address> &addr) override { + bool addParticipant(const std::shared_ptr<Address> &addr) override { bool status = Conference::addParticipant(addr); std::shared_ptr<Participant> p = findParticipant(addr); p->addDevice(addr); diff --git a/tester/local-chat-tester.cpp b/tester/local-chat-tester.cpp index 8c88b9c4dfd218b8108696d1c35a41f5f15d9248..deec756b55604cd72c0a4bf00a96196cc41efd57 100644 --- a/tester/local-chat-tester.cpp +++ b/tester/local-chat-tester.cpp @@ -2973,6 +2973,8 @@ static void multidomain_group_chat_room(void) { initialMichelleStats = michelle.getStats(); participantsAddresses = bctbx_list_append(NULL, linphone_address_ref(paulineAddr.toC())); participantsAddresses = bctbx_list_append(participantsAddresses, linphone_address_ref(michelleAddr.toC())); + ms_message("%s creates chat on conference server %s", linphone_core_get_identity(marie.getLc()), + focusAuth1DotExampleDotOrgFactoryAddress.toString().c_str()); LinphoneChatRoom *marieCrfocusAuth1DotExampleDotOrg = create_chat_room_client_side(coresList, marie.getCMgr(), &initialMarieStats, participantsAddresses, initialSubject, FALSE, LinphoneChatRoomEphemeralModeDeviceManaged); diff --git a/tester/local-conference-edition-tester.cpp b/tester/local-conference-edition-tester.cpp index 6634f46be1caf92c308b705c9d3da11b17b51541..185782622dc796bcf982364c37f4d517b67f813f 100644 --- a/tester/local-conference-edition-tester.cpp +++ b/tester/local-conference-edition-tester.cpp @@ -879,9 +879,9 @@ static void edit_simple_conference_base(bool_t from_organizer, if (conf_info) { linphone_conference_info_set_subject(conf_info, subject); linphone_conference_info_set_description(conf_info, description2); - // If the edition is not succesfull, the conference information is not updated - // It bring about that if Marie joined the conference, the old conference information information stays - // in the database and it has Marie as a participant + // If the edition is not successfull, the conference information is not updated + // It bring about that if Marie joined the conference, the old conference information stays in the + // database and it has Marie as a participant size_t ics_participant_number = 0; if (add) { linphone_conference_info_add_participant(conf_info, michelle.getCMgr()->identity); diff --git a/tester/message_tester.c b/tester/message_tester.c index c99011a2783e6547c7044225af62233397178e61..ef155b9700a8385b6684e9a3a21391ee131373bc 100644 --- a/tester/message_tester.c +++ b/tester/message_tester.c @@ -4610,7 +4610,7 @@ static int message_tester_before_suite(void) { command = bctbx_strdup_printf("mkdir -p %s/.local/share/linphone", home); err = system(command); if (err != -1 && WIFEXITED(err) && WEXITSTATUS(err) == 0) { - bctbx_message("%s done succesfully.", command); + bctbx_message("%s done successfully.", command); } else { bctbx_error("%s failed. Some tests may fail.", command); } diff --git a/tester/stun_tester.c b/tester/stun_tester.c index 26466c2a4313771a8ee798637d2da0e8b0e049b3..26389709ed999aae5eb50f9279dd887189724986 100644 --- a/tester/stun_tester.c +++ b/tester/stun_tester.c @@ -436,7 +436,7 @@ static void relayed_ice_turn_to_ice_with_dtls_srtp(void) { } /* specific test that checks that in the case of a call with DTLS-SRTP, ICE, and TURN - * the handshake is started immediately after ICE has succesfully verified the relay pair. + * the handshake is started immediately after ICE has successfully verified the relay pair. */ static void _ice_turn_dtls_call(const CallConfig *config) { LinphoneCoreManager *marie; diff --git a/tester/tester.c b/tester/tester.c index 20002d2631856539580ec0d27cd2579fc79a894b..d8392b84c4a13582de27753a91788b8ab4478a1f 100644 --- a/tester/tester.c +++ b/tester/tester.c @@ -161,7 +161,7 @@ const int x3dhServer_creationTimeout = 20000; // in ms, use this value for d // int liblinphonetester_transport_timeout = 9000; /*milliseconds. it is set to such low value to workaround a problem with our Freebox v6 when connecting to Ipv6 addresses. It was found that the freebox sometimes block SYN-ACK - packets, which prevents connection to be succesful. Thanks to the timeout, it will fallback to IPv4*/ + packets, which prevents connection to be successful. Thanks to the timeout, it will fallback to IPv4*/ char *message_external_body_url = NULL; static const char *notify_content = "<somexml2>blabla</somexml2>"; diff --git a/tools/lpsendmsg.c b/tools/lpsendmsg.c index 36df15de78646ac239d21e754f77564dd4bee0c6..74ce7846ed5d60d250732eefc1b8fd8ec8b13d86 100644 --- a/tools/lpsendmsg.c +++ b/tools/lpsendmsg.c @@ -63,7 +63,7 @@ static void on_msg_state_changed(BCTBX_UNUSED(LinphoneChatMessage *msg), Linphon running = FALSE; break; case LinphoneChatMessageStateDelivered: - printf("Message transmitted succesfully.\n"); + printf("Message transmitted successfully.\n"); running = FALSE; break; case LinphoneChatMessageStateDeliveredToUser: diff --git a/wrappers/java/classes/org/linphone/core/tools/service/CoreService.java b/wrappers/java/classes/org/linphone/core/tools/service/CoreService.java index 9f2695393b425227c3ee5b021a632820d962a517..c6c4d5e3ae2337c4a4161c37d929129f1a2d926f 100644 --- a/wrappers/java/classes/org/linphone/core/tools/service/CoreService.java +++ b/wrappers/java/classes/org/linphone/core/tools/service/CoreService.java @@ -209,7 +209,7 @@ public class CoreService extends Service { Log.i("[Core Service] Core Manager found, adding our listener"); core.addListener(mListener); mIsListenerAdded = true; - Log.i("[Core Service] CoreListener succesfully added to the Core"); + Log.i("[Core Service] CoreListener successfully added to the Core"); if (core.getCallsNb() > 0) { Log.w("[Core Service] Core listener added while at least one call active !");