From 73358b7a25ea8f3f760a41d853f0c520d27c2e7c Mon Sep 17 00:00:00 2001 From: gaelle Date: Tue, 16 Sep 2025 09:21:01 +0200 Subject: [PATCH] Conf info fixes : set default videoconference factory uri fix conf info message ui fix conversation infos call action always update all conf info on conf info received as we don't know which account is concerned fix #LINQT-1980 display meeting detail fix #LINQT-1986 force conferenceInfoReceived signal on meeting creation fix do not add conference if state is cancelled --- Linphone/core/account/AccountCore.cpp | 6 +++++ Linphone/core/account/AccountCore.hpp | 1 + .../core/conference/ConferenceInfoCore.cpp | 3 +++ .../core/conference/ConferenceInfoList.cpp | 14 ++++++++--- .../data/assistant/use-app-sip-account.rc | 2 +- Linphone/model/account/AccountManager.cpp | 24 +++++++++---------- Linphone/model/account/AccountModel.cpp | 9 +++++-- Linphone/model/account/AccountModel.hpp | 7 ++++++ .../Chat/ChatMessageInvitationBubble.qml | 2 ++ .../view/Page/Form/Chat/SelectedChatView.qml | 2 ++ .../Page/Layout/Chat/ConversationInfos.qml | 6 +++-- .../view/Page/Main/Meeting/MeetingPage.qml | 4 ++-- 12 files changed, 58 insertions(+), 22 deletions(-) diff --git a/Linphone/core/account/AccountCore.cpp b/Linphone/core/account/AccountCore.cpp index c5ba9d7ab..705fb30a9 100644 --- a/Linphone/core/account/AccountCore.cpp +++ b/Linphone/core/account/AccountCore.cpp @@ -155,6 +155,12 @@ void AccountCore::setSelf(QSharedPointer me) { mAccountModelConnection->invokeToCore( [this, account, state, message]() { onRegistrationStateChanged(account, state, message); }); }); + mAccountModelConnection->makeConnectToModel( + &AccountModel::conferenceInformationUpdated, + [this](const std::shared_ptr &account, + const std::list> &infos) { + mAccountModelConnection->invokeToCore([this]() { emit conferenceInformationUpdated(); }); + }); // From Model mAccountModelConnection->makeConnectToModel(&AccountModel::defaultAccountChanged, [this](bool isDefault) { mAccountModelConnection->invokeToCore([this, isDefault]() { onDefaultAccountChanged(isDefault); }); diff --git a/Linphone/core/account/AccountCore.hpp b/Linphone/core/account/AccountCore.hpp index bcf6b086c..6822aa450 100644 --- a/Linphone/core/account/AccountCore.hpp +++ b/Linphone/core/account/AccountCore.hpp @@ -193,6 +193,7 @@ public: signals: void pictureUriChanged(); void registrationStateChanged(const QString &message); + void conferenceInformationUpdated(); void defaultAccountChanged(bool isDefault); void unreadNotificationsChanged(int unread); void unreadCallNotificationsChanged(int unread); diff --git a/Linphone/core/conference/ConferenceInfoCore.cpp b/Linphone/core/conference/ConferenceInfoCore.cpp index 6b2b4fe2b..2bd413bf2 100644 --- a/Linphone/core/conference/ConferenceInfoCore.cpp +++ b/Linphone/core/conference/ConferenceInfoCore.cpp @@ -188,6 +188,9 @@ void ConferenceInfoCore::setSelf(QSharedPointer me) { QString uri; if (state == linphone::ConferenceScheduler::State::Ready) { uri = mConferenceInfoModel->getConferenceScheduler()->getUri(); + emit CoreModel::getInstance() -> conferenceInfoReceived( + CoreModel::getInstance()->getCore(), + mConferenceInfoModel->getConferenceInfo()); } mConfInfoModelConnection->invokeToCore([this, state = LinphoneEnums::fromLinphone(state), infoState = LinphoneEnums::fromLinphone(confInfoState), diff --git a/Linphone/core/conference/ConferenceInfoList.cpp b/Linphone/core/conference/ConferenceInfoList.cpp index 538a77cac..53f297e91 100644 --- a/Linphone/core/conference/ConferenceInfoList.cpp +++ b/Linphone/core/conference/ConferenceInfoList.cpp @@ -98,7 +98,9 @@ void ConferenceInfoList::setSelf(QSharedPointer me) { [this](const std::shared_ptr &core, const std::shared_ptr &conferenceInfo) { lDebug() << log().arg("conference info received") << conferenceInfo->getSubject(); - addConference(conferenceInfo->clone()); + // We must refresh all the conference infos cause we are not able to determine + // which account is concerned by the signal if multiple accounts are connected + emit lUpdate(); }); // This is needed because account does not have a contact address until @@ -109,12 +111,17 @@ void ConferenceInfoList::setSelf(QSharedPointer me) { [this](const std::shared_ptr &core, const std::shared_ptr &account) { auto accountCore = account ? AccountCore::create(account) : nullptr; mCoreModelConnection->invokeToCore([this, accountCore] { - if (mCurrentAccountCore) + if (mCurrentAccountCore) { disconnect(mCurrentAccountCore.get(), &AccountCore::registrationStateChanged, this, nullptr); + disconnect(mCurrentAccountCore.get(), &AccountCore::conferenceInformationUpdated, this, nullptr); + } mCurrentAccountCore = accountCore; - if (mCurrentAccountCore) + if (mCurrentAccountCore) { connect(mCurrentAccountCore.get(), &AccountCore::registrationStateChanged, this, [this] { emit lUpdate(); }); + connect(mCurrentAccountCore.get(), &AccountCore::conferenceInformationUpdated, this, + [this] { emit lUpdate(); }); + } emit lUpdate(); }); }); @@ -159,6 +166,7 @@ void ConferenceInfoList::addConference(const std::shared_ptrgetUri()->weakEqual(confAddr); }); if (haveConf == list.end()) { + if (confInfo->getState() == linphone::ConferenceInfo::State::Cancelled) return; auto confInfoCore = build(confInfo); mCoreModelConnection->invokeToCore([this, confInfoCore] { connectItem(confInfoCore); diff --git a/Linphone/data/assistant/use-app-sip-account.rc b/Linphone/data/assistant/use-app-sip-account.rc index 9ff54ebfa..fc29feeae 100644 --- a/Linphone/data/assistant/use-app-sip-account.rc +++ b/Linphone/data/assistant/use-app-sip-account.rc @@ -20,7 +20,7 @@ sip.linphone.org message-expires=2419200 sip:conference-factory@sip.linphone.org - + sip:videoconference-factory@sip.linphone.org 1 1 https://lime.linphone.org/lime-server/lime-server.php diff --git a/Linphone/model/account/AccountManager.cpp b/Linphone/model/account/AccountManager.cpp index 34630e260..c8bd70400 100644 --- a/Linphone/model/account/AccountManager.cpp +++ b/Linphone/model/account/AccountManager.cpp @@ -107,10 +107,9 @@ bool AccountManager::login(QString username, .arg(QStringLiteral("Unable to set identity address: `%1`.")) .arg(Utils::coreStringToAppString(identity->asStringUriOnly())); - //: "Impossible de configurer l'adresse : `%1`." - *errorMessage = - tr("assistant_account_login_address_configuration_error").arg(Utils::coreStringToAppString(identity->asStringUriOnly())); + *errorMessage = tr("assistant_account_login_address_configuration_error") + .arg(Utils::coreStringToAppString(identity->asStringUriOnly())); return false; } @@ -131,25 +130,26 @@ bool AccountManager::login(QString username, mAccountModel->setSelf(mAccountModel); connect(mAccountModel.get(), &AccountModel::registrationStateChanged, this, [this, authInfo, core](const std::shared_ptr &account, linphone::RegistrationState state, - const std::string &message) { - QString errorMessage = QString::fromStdString(message); + const std::string &message) { + QString errorMessage = QString::fromStdString(message); if (mAccountModel && account == mAccountModel->getAccount()) { if (state == linphone::RegistrationState::Failed) { connect( mAccountModel.get(), &AccountModel::removed, this, [this]() { mAccountModel = nullptr; }, Qt::SingleShotConnection); - //: "Le couple identifiant mot de passe ne correspond pas" - if (account->getError() == linphone::Reason::Forbidden) errorMessage = tr("assistant_account_login_forbidden_error"); - //: "Erreur durant la connexion" - else errorMessage = tr("assistant_account_login_error"); - mAccountModel->removeAccount(); + //: "Le couple identifiant mot de passe ne correspond pas" + if (account->getError() == linphone::Reason::Forbidden) + errorMessage = tr("assistant_account_login_forbidden_error"); + //: "Erreur durant la connexion" + else errorMessage = tr("assistant_account_login_error"); + mAccountModel->removeAccount(); } else if (state == linphone::RegistrationState::Ok) { core->setDefaultAccount(account); emit mAccountModel->removeListener(); mAccountModel = nullptr; } - } - emit registrationStateChanged(state, errorMessage); + } + emit registrationStateChanged(state, errorMessage); }); auto status = core->addAccount(account); if (status == -1) { diff --git a/Linphone/model/account/AccountModel.cpp b/Linphone/model/account/AccountModel.cpp index 9b3938c65..5bb044948 100644 --- a/Linphone/model/account/AccountModel.cpp +++ b/Linphone/model/account/AccountModel.cpp @@ -86,6 +86,11 @@ void AccountModel::onRegistrationStateChanged(const std::shared_ptr &account, + const std::list> &infos) { + emit conferenceInformationUpdated(account, infos); +} + void AccountModel::onMessageWaitingIndicationChanged( const std::shared_ptr &account, const std::shared_ptr &mwi) { @@ -120,7 +125,7 @@ void AccountModel::setPictureUri(QString uri) { // Hack because Account doesn't provide callbacks on updated data // emit pictureUriChanged(uri); auto core = CoreModel::getInstance()->getCore(); - emit CoreModel::getInstance()->defaultAccountChanged(core, core->getDefaultAccount()); + emit CoreModel::getInstance() -> defaultAccountChanged(core, core->getDefaultAccount()); } void AccountModel::onDefaultAccountChanged() { @@ -177,7 +182,7 @@ void AccountModel::setDisplayName(QString displayName) { // Hack because Account doesn't provide callbacks on updated data // emit displayNameChanged(displayName); auto core = CoreModel::getInstance()->getCore(); - emit CoreModel::getInstance()->defaultAccountChanged(core, core->getDefaultAccount()); + emit CoreModel::getInstance() -> defaultAccountChanged(core, core->getDefaultAccount()); } void AccountModel::setDialPlan(int index) { diff --git a/Linphone/model/account/AccountModel.hpp b/Linphone/model/account/AccountModel.hpp index eb0c73558..083b474bd 100644 --- a/Linphone/model/account/AccountModel.hpp +++ b/Linphone/model/account/AccountModel.hpp @@ -93,6 +93,10 @@ signals: void registrationStateChanged(const std::shared_ptr &account, linphone::RegistrationState state, const std::string &message); + + void conferenceInformationUpdated(const std::shared_ptr &account, + const std::list> &infos); + void defaultAccountChanged(bool isDefault); void pictureUriChanged(QString uri); @@ -130,6 +134,9 @@ private: onMessageWaitingIndicationChanged(const std::shared_ptr &account, const std::shared_ptr &mwi) override; + virtual void + onConferenceInformationUpdated(const std::shared_ptr &account, + const std::list> &infos) override; // UserData static void setUserData(const std::shared_ptr &account, std::shared_ptr &data); static std::shared_ptr getUserData(const std::shared_ptr &account); diff --git a/Linphone/view/Control/Display/Chat/ChatMessageInvitationBubble.qml b/Linphone/view/Control/Display/Chat/ChatMessageInvitationBubble.qml index b7aadc65d..8f24f8aee 100644 --- a/Linphone/view/Control/Display/Chat/ChatMessageInvitationBubble.qml +++ b/Linphone/view/Control/Display/Chat/ChatMessageInvitationBubble.qml @@ -187,6 +187,7 @@ ColumnLayout { Rectangle { + visible: conferenceInfo.description.length > 0 || conferenceInfo.participantCount > 0 Layout.fillWidth: true height: 10 * DefaultStyle.dp color: DefaultStyle.grey_100 @@ -194,6 +195,7 @@ ColumnLayout { z: infoControl.z + 1 } Rectangle { + visible: conferenceInfo.description.length > 0 || conferenceInfo.participantCount > 0 Layout.fillWidth: true height: 10 * DefaultStyle.dp color: DefaultStyle.grey_0 diff --git a/Linphone/view/Page/Form/Chat/SelectedChatView.qml b/Linphone/view/Page/Form/Chat/SelectedChatView.qml index 9d445d70d..e80ef2f34 100644 --- a/Linphone/view/Page/Form/Chat/SelectedChatView.qml +++ b/Linphone/view/Page/Form/Chat/SelectedChatView.qml @@ -596,6 +596,8 @@ FocusScope { contentLoader.panelType = showMedias ? SelectedChatView.PanelType.Medias : SelectedChatView.PanelType.SharedFiles } onManageParticipantsRequested: contentLoader.panelType = SelectedChatView.PanelType.ManageParticipants + onOneOneCall: (video) => mainItem.oneOneCall(video) + onGroupCall: mainItem.groupCall() } } diff --git a/Linphone/view/Page/Layout/Chat/ConversationInfos.qml b/Linphone/view/Page/Layout/Chat/ConversationInfos.qml index be15ff6a5..007c3e30d 100644 --- a/Linphone/view/Page/Layout/Chat/ConversationInfos.qml +++ b/Linphone/view/Page/Layout/Chat/ConversationInfos.qml @@ -16,13 +16,15 @@ ColumnLayout { property var contactObj: chatGui ? UtilsCpp.findFriendByAddress(mainItem.chatCore.peerAddress) : null property FriendGui contact: contactObj ? contactObj.value : null property bool isAppFriend: contact && contact.core.isAppFriend - property var parentView property bool isGroup: chatCore && chatCore.isGroupChat spacing: 0 signal ephemeralSettingsRequested() signal showSharedFilesRequested(bool showMedias) signal manageParticipantsRequested() + signal oneOneCall(bool video) + signal groupCall() + Avatar { Layout.alignment: Qt.AlignHCenter contact: mainItem.contact @@ -185,7 +187,7 @@ ColumnLayout { button.icon.source: AppIcons.phone //: "Appel" label: qsTr("one_one_infos_call") - button.onClicked: mainItem.isGroup ? parentView.groupCall() : parentView.oneOneCall(false) + button.onClicked: mainItem.isGroup ? mainItem.groupCall() : mainItem.oneOneCall(false) } LabelButton { text.Layout.fillWidth: true diff --git a/Linphone/view/Page/Main/Meeting/MeetingPage.qml b/Linphone/view/Page/Main/Meeting/MeetingPage.qml index 711e6300a..15c30cb73 100644 --- a/Linphone/view/Page/Main/Meeting/MeetingPage.qml +++ b/Linphone/view/Page/Main/Meeting/MeetingPage.qml @@ -11,7 +11,7 @@ AbstractMainPage { id: mainItem property ConferenceInfoGui selectedConference - property int meetingListCount + property int meetingListCount: 0 signal returnRequested() signal addParticipantsValidated(list selectedParticipants) //: "Créer une réunion" @@ -251,7 +251,7 @@ AbstractMainPage { searchBarText: searchBar.text onCountChanged: { - mainItem.meetingListCount = count === 0 + mainItem.meetingListCount = count } Binding { target: mainItem