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
This commit is contained in:
gaelle 2025-09-16 09:21:01 +02:00
parent c007e975aa
commit 73358b7a25
12 changed files with 58 additions and 22 deletions

View file

@ -155,6 +155,12 @@ void AccountCore::setSelf(QSharedPointer<AccountCore> me) {
mAccountModelConnection->invokeToCore( mAccountModelConnection->invokeToCore(
[this, account, state, message]() { onRegistrationStateChanged(account, state, message); }); [this, account, state, message]() { onRegistrationStateChanged(account, state, message); });
}); });
mAccountModelConnection->makeConnectToModel(
&AccountModel::conferenceInformationUpdated,
[this](const std::shared_ptr<linphone::Account> &account,
const std::list<std::shared_ptr<linphone::ConferenceInfo>> &infos) {
mAccountModelConnection->invokeToCore([this]() { emit conferenceInformationUpdated(); });
});
// From Model // From Model
mAccountModelConnection->makeConnectToModel(&AccountModel::defaultAccountChanged, [this](bool isDefault) { mAccountModelConnection->makeConnectToModel(&AccountModel::defaultAccountChanged, [this](bool isDefault) {
mAccountModelConnection->invokeToCore([this, isDefault]() { onDefaultAccountChanged(isDefault); }); mAccountModelConnection->invokeToCore([this, isDefault]() { onDefaultAccountChanged(isDefault); });

View file

@ -193,6 +193,7 @@ public:
signals: signals:
void pictureUriChanged(); void pictureUriChanged();
void registrationStateChanged(const QString &message); void registrationStateChanged(const QString &message);
void conferenceInformationUpdated();
void defaultAccountChanged(bool isDefault); void defaultAccountChanged(bool isDefault);
void unreadNotificationsChanged(int unread); void unreadNotificationsChanged(int unread);
void unreadCallNotificationsChanged(int unread); void unreadCallNotificationsChanged(int unread);

View file

@ -188,6 +188,9 @@ void ConferenceInfoCore::setSelf(QSharedPointer<ConferenceInfoCore> me) {
QString uri; QString uri;
if (state == linphone::ConferenceScheduler::State::Ready) { if (state == linphone::ConferenceScheduler::State::Ready) {
uri = mConferenceInfoModel->getConferenceScheduler()->getUri(); uri = mConferenceInfoModel->getConferenceScheduler()->getUri();
emit CoreModel::getInstance() -> conferenceInfoReceived(
CoreModel::getInstance()->getCore(),
mConferenceInfoModel->getConferenceInfo());
} }
mConfInfoModelConnection->invokeToCore([this, state = LinphoneEnums::fromLinphone(state), mConfInfoModelConnection->invokeToCore([this, state = LinphoneEnums::fromLinphone(state),
infoState = LinphoneEnums::fromLinphone(confInfoState), infoState = LinphoneEnums::fromLinphone(confInfoState),

View file

@ -98,7 +98,9 @@ void ConferenceInfoList::setSelf(QSharedPointer<ConferenceInfoList> me) {
[this](const std::shared_ptr<linphone::Core> &core, [this](const std::shared_ptr<linphone::Core> &core,
const std::shared_ptr<const linphone::ConferenceInfo> &conferenceInfo) { const std::shared_ptr<const linphone::ConferenceInfo> &conferenceInfo) {
lDebug() << log().arg("conference info received") << conferenceInfo->getSubject(); 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 // This is needed because account does not have a contact address until
@ -109,12 +111,17 @@ void ConferenceInfoList::setSelf(QSharedPointer<ConferenceInfoList> me) {
[this](const std::shared_ptr<linphone::Core> &core, const std::shared_ptr<linphone::Account> &account) { [this](const std::shared_ptr<linphone::Core> &core, const std::shared_ptr<linphone::Account> &account) {
auto accountCore = account ? AccountCore::create(account) : nullptr; auto accountCore = account ? AccountCore::create(account) : nullptr;
mCoreModelConnection->invokeToCore([this, accountCore] { mCoreModelConnection->invokeToCore([this, accountCore] {
if (mCurrentAccountCore) if (mCurrentAccountCore) {
disconnect(mCurrentAccountCore.get(), &AccountCore::registrationStateChanged, this, nullptr); disconnect(mCurrentAccountCore.get(), &AccountCore::registrationStateChanged, this, nullptr);
disconnect(mCurrentAccountCore.get(), &AccountCore::conferenceInformationUpdated, this, nullptr);
}
mCurrentAccountCore = accountCore; mCurrentAccountCore = accountCore;
if (mCurrentAccountCore) if (mCurrentAccountCore) {
connect(mCurrentAccountCore.get(), &AccountCore::registrationStateChanged, this, connect(mCurrentAccountCore.get(), &AccountCore::registrationStateChanged, this,
[this] { emit lUpdate(); }); [this] { emit lUpdate(); });
connect(mCurrentAccountCore.get(), &AccountCore::conferenceInformationUpdated, this,
[this] { emit lUpdate(); });
}
emit lUpdate(); emit lUpdate();
}); });
}); });
@ -159,6 +166,7 @@ void ConferenceInfoList::addConference(const std::shared_ptr<linphone::Conferenc
return confInfo->getUri()->weakEqual(confAddr); return confInfo->getUri()->weakEqual(confAddr);
}); });
if (haveConf == list.end()) { if (haveConf == list.end()) {
if (confInfo->getState() == linphone::ConferenceInfo::State::Cancelled) return;
auto confInfoCore = build(confInfo); auto confInfoCore = build(confInfo);
mCoreModelConnection->invokeToCore([this, confInfoCore] { mCoreModelConnection->invokeToCore([this, confInfoCore] {
connectItem(confInfoCore); connectItem(confInfoCore);

View file

@ -20,7 +20,7 @@
<entry name="realm" overwrite="true">sip.linphone.org</entry> <entry name="realm" overwrite="true">sip.linphone.org</entry>
<entry name="contact_parameters" overwrite="true">message-expires=2419200</entry> <entry name="contact_parameters" overwrite="true">message-expires=2419200</entry>
<entry name="conference_factory_uri" overwrite="true">sip:conference-factory@sip.linphone.org</entry> <entry name="conference_factory_uri" overwrite="true">sip:conference-factory@sip.linphone.org</entry>
<!--<entry name="audio_video_conference_factory_uri" overwrite="true">sip:videoconference-factory@sip.linphone.org</entry>--> <entry name="audio_video_conference_factory_uri" overwrite="true">sip:videoconference-factory@sip.linphone.org</entry>
<entry name="cpim_in_basic_chat_rooms_enabled" overwrite="true">1</entry> <entry name="cpim_in_basic_chat_rooms_enabled" overwrite="true">1</entry>
<entry name="rtp_bundle" overwrite="true">1</entry> <entry name="rtp_bundle" overwrite="true">1</entry>
<entry name="lime_server_url" overwrite="true">https://lime.linphone.org/lime-server/lime-server.php</entry> <entry name="lime_server_url" overwrite="true">https://lime.linphone.org/lime-server/lime-server.php</entry>

View file

@ -107,10 +107,9 @@ bool AccountManager::login(QString username,
.arg(QStringLiteral("Unable to set identity address: `%1`.")) .arg(QStringLiteral("Unable to set identity address: `%1`."))
.arg(Utils::coreStringToAppString(identity->asStringUriOnly())); .arg(Utils::coreStringToAppString(identity->asStringUriOnly()));
//: "Impossible de configurer l'adresse : `%1`." //: "Impossible de configurer l'adresse : `%1`."
*errorMessage = *errorMessage = tr("assistant_account_login_address_configuration_error")
tr("assistant_account_login_address_configuration_error").arg(Utils::coreStringToAppString(identity->asStringUriOnly())); .arg(Utils::coreStringToAppString(identity->asStringUriOnly()));
return false; return false;
} }
@ -131,25 +130,26 @@ bool AccountManager::login(QString username,
mAccountModel->setSelf(mAccountModel); mAccountModel->setSelf(mAccountModel);
connect(mAccountModel.get(), &AccountModel::registrationStateChanged, this, connect(mAccountModel.get(), &AccountModel::registrationStateChanged, this,
[this, authInfo, core](const std::shared_ptr<linphone::Account> &account, linphone::RegistrationState state, [this, authInfo, core](const std::shared_ptr<linphone::Account> &account, linphone::RegistrationState state,
const std::string &message) { const std::string &message) {
QString errorMessage = QString::fromStdString(message); QString errorMessage = QString::fromStdString(message);
if (mAccountModel && account == mAccountModel->getAccount()) { if (mAccountModel && account == mAccountModel->getAccount()) {
if (state == linphone::RegistrationState::Failed) { if (state == linphone::RegistrationState::Failed) {
connect( connect(
mAccountModel.get(), &AccountModel::removed, this, [this]() { mAccountModel = nullptr; }, mAccountModel.get(), &AccountModel::removed, this, [this]() { mAccountModel = nullptr; },
Qt::SingleShotConnection); Qt::SingleShotConnection);
//: "Le couple identifiant mot de passe ne correspond pas" //: "Le couple identifiant mot de passe ne correspond pas"
if (account->getError() == linphone::Reason::Forbidden) errorMessage = tr("assistant_account_login_forbidden_error"); if (account->getError() == linphone::Reason::Forbidden)
//: "Erreur durant la connexion" errorMessage = tr("assistant_account_login_forbidden_error");
else errorMessage = tr("assistant_account_login_error"); //: "Erreur durant la connexion"
mAccountModel->removeAccount(); else errorMessage = tr("assistant_account_login_error");
mAccountModel->removeAccount();
} else if (state == linphone::RegistrationState::Ok) { } else if (state == linphone::RegistrationState::Ok) {
core->setDefaultAccount(account); core->setDefaultAccount(account);
emit mAccountModel->removeListener(); emit mAccountModel->removeListener();
mAccountModel = nullptr; mAccountModel = nullptr;
} }
} }
emit registrationStateChanged(state, errorMessage); emit registrationStateChanged(state, errorMessage);
}); });
auto status = core->addAccount(account); auto status = core->addAccount(account);
if (status == -1) { if (status == -1) {

View file

@ -86,6 +86,11 @@ void AccountModel::onRegistrationStateChanged(const std::shared_ptr<linphone::Ac
emit registrationStateChanged(account, state, message); emit registrationStateChanged(account, state, message);
} }
void AccountModel::onConferenceInformationUpdated(const std::shared_ptr<linphone::Account> &account,
const std::list<std::shared_ptr<linphone::ConferenceInfo>> &infos) {
emit conferenceInformationUpdated(account, infos);
}
void AccountModel::onMessageWaitingIndicationChanged( void AccountModel::onMessageWaitingIndicationChanged(
const std::shared_ptr<linphone::Account> &account, const std::shared_ptr<linphone::Account> &account,
const std::shared_ptr<const linphone::MessageWaitingIndication> &mwi) { const std::shared_ptr<const linphone::MessageWaitingIndication> &mwi) {
@ -120,7 +125,7 @@ void AccountModel::setPictureUri(QString uri) {
// Hack because Account doesn't provide callbacks on updated data // Hack because Account doesn't provide callbacks on updated data
// emit pictureUriChanged(uri); // emit pictureUriChanged(uri);
auto core = CoreModel::getInstance()->getCore(); auto core = CoreModel::getInstance()->getCore();
emit CoreModel::getInstance()->defaultAccountChanged(core, core->getDefaultAccount()); emit CoreModel::getInstance() -> defaultAccountChanged(core, core->getDefaultAccount());
} }
void AccountModel::onDefaultAccountChanged() { void AccountModel::onDefaultAccountChanged() {
@ -177,7 +182,7 @@ void AccountModel::setDisplayName(QString displayName) {
// Hack because Account doesn't provide callbacks on updated data // Hack because Account doesn't provide callbacks on updated data
// emit displayNameChanged(displayName); // emit displayNameChanged(displayName);
auto core = CoreModel::getInstance()->getCore(); auto core = CoreModel::getInstance()->getCore();
emit CoreModel::getInstance()->defaultAccountChanged(core, core->getDefaultAccount()); emit CoreModel::getInstance() -> defaultAccountChanged(core, core->getDefaultAccount());
} }
void AccountModel::setDialPlan(int index) { void AccountModel::setDialPlan(int index) {

View file

@ -93,6 +93,10 @@ signals:
void registrationStateChanged(const std::shared_ptr<linphone::Account> &account, void registrationStateChanged(const std::shared_ptr<linphone::Account> &account,
linphone::RegistrationState state, linphone::RegistrationState state,
const std::string &message); const std::string &message);
void conferenceInformationUpdated(const std::shared_ptr<linphone::Account> &account,
const std::list<std::shared_ptr<linphone::ConferenceInfo>> &infos);
void defaultAccountChanged(bool isDefault); void defaultAccountChanged(bool isDefault);
void pictureUriChanged(QString uri); void pictureUriChanged(QString uri);
@ -130,6 +134,9 @@ private:
onMessageWaitingIndicationChanged(const std::shared_ptr<linphone::Account> &account, onMessageWaitingIndicationChanged(const std::shared_ptr<linphone::Account> &account,
const std::shared_ptr<const linphone::MessageWaitingIndication> &mwi) override; const std::shared_ptr<const linphone::MessageWaitingIndication> &mwi) override;
virtual void
onConferenceInformationUpdated(const std::shared_ptr<linphone::Account> &account,
const std::list<std::shared_ptr<linphone::ConferenceInfo>> &infos) override;
// UserData // UserData
static void setUserData(const std::shared_ptr<linphone::Account> &account, std::shared_ptr<AccountUserData> &data); static void setUserData(const std::shared_ptr<linphone::Account> &account, std::shared_ptr<AccountUserData> &data);
static std::shared_ptr<AccountUserData> getUserData(const std::shared_ptr<linphone::Account> &account); static std::shared_ptr<AccountUserData> getUserData(const std::shared_ptr<linphone::Account> &account);

View file

@ -187,6 +187,7 @@ ColumnLayout {
Rectangle { Rectangle {
visible: conferenceInfo.description.length > 0 || conferenceInfo.participantCount > 0
Layout.fillWidth: true Layout.fillWidth: true
height: 10 * DefaultStyle.dp height: 10 * DefaultStyle.dp
color: DefaultStyle.grey_100 color: DefaultStyle.grey_100
@ -194,6 +195,7 @@ ColumnLayout {
z: infoControl.z + 1 z: infoControl.z + 1
} }
Rectangle { Rectangle {
visible: conferenceInfo.description.length > 0 || conferenceInfo.participantCount > 0
Layout.fillWidth: true Layout.fillWidth: true
height: 10 * DefaultStyle.dp height: 10 * DefaultStyle.dp
color: DefaultStyle.grey_0 color: DefaultStyle.grey_0

View file

@ -596,6 +596,8 @@ FocusScope {
contentLoader.panelType = showMedias ? SelectedChatView.PanelType.Medias : SelectedChatView.PanelType.SharedFiles contentLoader.panelType = showMedias ? SelectedChatView.PanelType.Medias : SelectedChatView.PanelType.SharedFiles
} }
onManageParticipantsRequested: contentLoader.panelType = SelectedChatView.PanelType.ManageParticipants onManageParticipantsRequested: contentLoader.panelType = SelectedChatView.PanelType.ManageParticipants
onOneOneCall: (video) => mainItem.oneOneCall(video)
onGroupCall: mainItem.groupCall()
} }
} }

View file

@ -16,13 +16,15 @@ ColumnLayout {
property var contactObj: chatGui ? UtilsCpp.findFriendByAddress(mainItem.chatCore.peerAddress) : null property var contactObj: chatGui ? UtilsCpp.findFriendByAddress(mainItem.chatCore.peerAddress) : null
property FriendGui contact: contactObj ? contactObj.value : null property FriendGui contact: contactObj ? contactObj.value : null
property bool isAppFriend: contact && contact.core.isAppFriend property bool isAppFriend: contact && contact.core.isAppFriend
property var parentView
property bool isGroup: chatCore && chatCore.isGroupChat property bool isGroup: chatCore && chatCore.isGroupChat
spacing: 0 spacing: 0
signal ephemeralSettingsRequested() signal ephemeralSettingsRequested()
signal showSharedFilesRequested(bool showMedias) signal showSharedFilesRequested(bool showMedias)
signal manageParticipantsRequested() signal manageParticipantsRequested()
signal oneOneCall(bool video)
signal groupCall()
Avatar { Avatar {
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
contact: mainItem.contact contact: mainItem.contact
@ -185,7 +187,7 @@ ColumnLayout {
button.icon.source: AppIcons.phone button.icon.source: AppIcons.phone
//: "Appel" //: "Appel"
label: qsTr("one_one_infos_call") 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 { LabelButton {
text.Layout.fillWidth: true text.Layout.fillWidth: true

View file

@ -11,7 +11,7 @@ AbstractMainPage {
id: mainItem id: mainItem
property ConferenceInfoGui selectedConference property ConferenceInfoGui selectedConference
property int meetingListCount property int meetingListCount: 0
signal returnRequested() signal returnRequested()
signal addParticipantsValidated(list<string> selectedParticipants) signal addParticipantsValidated(list<string> selectedParticipants)
//: "Créer une réunion" //: "Créer une réunion"
@ -251,7 +251,7 @@ AbstractMainPage {
searchBarText: searchBar.text searchBarText: searchBar.text
onCountChanged: { onCountChanged: {
mainItem.meetingListCount = count === 0 mainItem.meetingListCount = count
} }
Binding { Binding {
target: mainItem target: mainItem