Avoid displaying the alone message at the start of the conference by letting time to be initialized.

This commit is contained in:
Julien Wadel 2022-08-30 14:19:28 +02:00
parent 15f6392bcd
commit df8d7f2052
2 changed files with 16 additions and 6 deletions

View file

@ -65,6 +65,7 @@ ConferenceModel::ConferenceModel (std::shared_ptr<linphone::Conference> 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);
}

View file

@ -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)
}
// ---------------------------------------------------------------------------