From df8d7f20529cb72a7bbdb2d4ee323e4fbedce17b Mon Sep 17 00:00:00 2001 From: Julien Wadel Date: Tue, 30 Aug 2022 14:19:28 +0200 Subject: [PATCH] Avoid displaying the alone message at the start of the conference by letting time to be initialized. --- .../components/conference/ConferenceModel.cpp | 5 ++++- linphone-app/ui/views/App/Calls/Incall.qml | 17 ++++++++++++----- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/linphone-app/src/components/conference/ConferenceModel.cpp b/linphone-app/src/components/conference/ConferenceModel.cpp index 7a884df5b..03144b2ac 100644 --- a/linphone-app/src/components/conference/ConferenceModel.cpp +++ b/linphone-app/src/components/conference/ConferenceModel.cpp @@ -65,6 +65,7 @@ ConferenceModel::ConferenceModel (std::shared_ptr conferen mConference->addListener(mConferenceListener); connect(this, &ConferenceModel::participantDeviceAdded, this, &ConferenceModel::participantDeviceCountChanged); connect(this, &ConferenceModel::participantDeviceRemoved, this, &ConferenceModel::participantDeviceCountChanged); + connect(mParticipantListModel.get(), &ParticipantListModel::participantsChanged, this, &ConferenceModel::participantDeviceCountChanged); } ConferenceModel::~ConferenceModel(){ @@ -182,8 +183,10 @@ void ConferenceModel::onParticipantDeviceIsSpeakingChanged(const std::shared_ptr emit participantDeviceIsSpeakingChanged(participantDevice, isSpeaking); } void ConferenceModel::onConferenceStateChanged(linphone::Conference::State newState){ - if(newState == linphone::Conference::State::Created) + if(newState == linphone::Conference::State::Created){ setIsReady(true); + emit participantDeviceCountChanged(); + } updateLocalParticipant(); emit conferenceStateChanged(newState); } diff --git a/linphone-app/ui/views/App/Calls/Incall.qml b/linphone-app/ui/views/App/Calls/Incall.qml index bfce0ea24..b1dfa0302 100644 --- a/linphone-app/ui/views/App/Calls/Incall.qml +++ b/linphone-app/ui/views/App/Calls/Incall.qml @@ -35,9 +35,9 @@ Rectangle { signal openListCallsRequest() - property int participantCount: mainItem.conferenceModel + property int participantCount: mainItem.conferenceModel ? mainItem.conferenceModel.participantDeviceCount - : conferenceLayout.item ? conferenceLayout.item.participantCount : 0 + : conferenceLayout.item ? conferenceLayout.item.participantCount : 2 // States property bool isAudioOnly: callModel && callModel.isConference && conferenceLayout.sourceComponent == gridComponent && !callModel.videoEnabled @@ -50,8 +50,13 @@ Rectangle { //: ''You are alone in this conference' : Text in message banner when the user is the only participant. if( isReady && participantCount <= 1) messageBanner.noticeBannerText = qsTr('aloneInConference') } - onParticipantCountChanged: updateMessageBanner() - onIsReadyChanged: updateMessageBanner() + Timer{ + id: delayMessageBanner + interval: 100 + onTriggered: updateMessageBanner() + } + onParticipantCountChanged: delayMessageBanner.restart() + onIsReadyChanged: delayMessageBanner.restart() // --------------------------------------------------------------------------- color: IncallStyle.backgroundColor @@ -60,7 +65,9 @@ Rectangle { target: callModel onCameraFirstFrameReceived: Logic.handleCameraFirstFrameReceived(width, height) - onStatusChanged: Logic.handleStatusChanged (status, mainItem._fullscreen) + onStatusChanged: {Logic.handleStatusChanged (status, mainItem._fullscreen) + delayMessageBanner.restart() + } onVideoRequested: Logic.handleVideoRequested(callModel) } // ---------------------------------------------------------------------------