mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-17 11:28:07 +00:00
Close conference creation after creation(2s)
Fix conference list synchronization when a new conference have been created.
This commit is contained in:
parent
f52932eb45
commit
c4c50cb4ec
7 changed files with 38 additions and 7 deletions
|
|
@ -23,6 +23,7 @@
|
|||
#include <QQmlApplicationEngine>
|
||||
|
||||
#include <algorithm>
|
||||
#include <QDebug>
|
||||
#include "CallModel.hpp"
|
||||
|
||||
// =============================================================================
|
||||
|
|
|
|||
|
|
@ -164,6 +164,10 @@ bool ConferenceInfoModel::isScheduled() const{
|
|||
return mIsScheduled;
|
||||
}
|
||||
|
||||
int ConferenceInfoModel::getInviteMode() const{
|
||||
return mInviteMode;
|
||||
}
|
||||
|
||||
QVariantList ConferenceInfoModel::getParticipants() const{
|
||||
QVariantList addresses;
|
||||
for(auto item : mConferenceInfo->getParticipants()){
|
||||
|
|
@ -248,9 +252,16 @@ void ConferenceInfoModel::setIsScheduled(const bool& on){
|
|||
}
|
||||
}
|
||||
|
||||
void ConferenceInfoModel::setInviteMode(const int& mode){
|
||||
if( mode != mInviteMode){
|
||||
mInviteMode = mode;
|
||||
emit inviteModeChanged();
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------------
|
||||
|
||||
void ConferenceInfoModel::createConference(const int& securityLevel, const int& inviteMode) {
|
||||
void ConferenceInfoModel::createConference(const int& securityLevel) {
|
||||
CoreManager::getInstance()->getTimelineListModel()->mAutoSelectAfterCreation = false;
|
||||
shared_ptr<linphone::Core> core = CoreManager::getInstance()->getCore();
|
||||
static std::shared_ptr<linphone::Conference> conference;
|
||||
|
|
@ -261,7 +272,7 @@ void ConferenceInfoModel::createConference(const int& securityLevel, const int&
|
|||
|
||||
|
||||
mConferenceScheduler = ConferenceScheduler::create();
|
||||
mConferenceScheduler->mSendInvite = inviteMode;
|
||||
mConferenceScheduler->mSendInvite = mInviteMode;
|
||||
connect(mConferenceScheduler.get(), &ConferenceScheduler::invitationsSent, this, &ConferenceInfoModel::onInvitationsSent);
|
||||
connect(mConferenceScheduler.get(), &ConferenceScheduler::stateChanged, this, &ConferenceInfoModel::onStateChanged);
|
||||
mConferenceScheduler->getConferenceScheduler()->setInfo(mConferenceInfo);
|
||||
|
|
|
|||
|
|
@ -46,6 +46,7 @@ public:
|
|||
Q_PROPERTY(QString displayNamesToString READ displayNamesToString NOTIFY participantsChanged)
|
||||
Q_PROPERTY(QString uri READ getUri NOTIFY uriChanged)
|
||||
Q_PROPERTY(bool isScheduled READ isScheduled WRITE setIsScheduled NOTIFY isScheduledChanged)
|
||||
Q_PROPERTY(int inviteMode READ getInviteMode WRITE setInviteMode NOTIFY inviteModeChanged)
|
||||
|
||||
static QSharedPointer<ConferenceInfoModel> create(std::shared_ptr<linphone::ConferenceInfo> conferenceInfo);
|
||||
ConferenceInfoModel (QObject * parent = nullptr);
|
||||
|
|
@ -66,6 +67,7 @@ public:
|
|||
Q_INVOKABLE QString displayNamesToString()const;
|
||||
QString getUri() const;
|
||||
bool isScheduled() const;
|
||||
int getInviteMode() const;
|
||||
Q_INVOKABLE QVariantList getParticipants() const;
|
||||
Q_INVOKABLE int getParticipantCount()const;
|
||||
Q_INVOKABLE TimeZoneModel* getTimeZoneModel() const;
|
||||
|
|
@ -77,12 +79,13 @@ public:
|
|||
void setOrganizer(const QString& organizerAddress);
|
||||
void setDescription(const QString& description);
|
||||
void setIsScheduled(const bool& on);
|
||||
void setInviteMode(const int& modes);
|
||||
|
||||
Q_INVOKABLE void setParticipants(ParticipantListModel * participants);
|
||||
Q_INVOKABLE void setTimeZoneModel(TimeZoneModel * model);
|
||||
|
||||
// Tools
|
||||
Q_INVOKABLE void createConference(const int& securityLevel, const int& inviteMode);
|
||||
Q_INVOKABLE void createConference(const int& securityLevel);
|
||||
Q_INVOKABLE void deleteConferenceInfo();// Remove completly this conference info from DB
|
||||
|
||||
// SCHEDULER
|
||||
|
|
@ -101,6 +104,7 @@ signals:
|
|||
void participantsChanged();
|
||||
void uriChanged();
|
||||
void isScheduledChanged();
|
||||
void inviteModeChanged();
|
||||
|
||||
void conferenceCreated();
|
||||
void conferenceCreationFailed();
|
||||
|
|
@ -113,6 +117,7 @@ private:
|
|||
QTimeZone mTimeZone;
|
||||
|
||||
bool mIsScheduled = true;
|
||||
int mInviteMode = 0;
|
||||
};
|
||||
|
||||
Q_DECLARE_METATYPE(QSharedPointer<ConferenceInfoModel>)
|
||||
|
|
|
|||
|
|
@ -69,5 +69,6 @@ void ConferenceInfoProxyModel::onConferenceInfoReceived(const std::shared_ptr<co
|
|||
if( realConferenceInfo ){
|
||||
auto model = qobject_cast<ConferenceInfoMapModel*>(sourceModel());
|
||||
model->add(realConferenceInfo);
|
||||
}
|
||||
}else
|
||||
qWarning() << "No conferenceInfo have beend found for " << conferenceInfo->getUri()->asString().c_str();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@
|
|||
|
||||
#include <QQmlApplicationEngine>
|
||||
#include "app/App.hpp"
|
||||
#include "components/core/CoreHandlers.hpp"
|
||||
#include "components/core/CoreManager.hpp"
|
||||
|
||||
void ConferenceScheduler::connectTo(ConferenceSchedulerListener * listener){
|
||||
|
|
@ -57,6 +58,7 @@ void ConferenceScheduler::onStateChanged(linphone::ConferenceSchedulerState stat
|
|||
qDebug() << "ConferenceScheduler::onStateChanged : " << (int)state;
|
||||
emit stateChanged(state);
|
||||
if( state == linphone::ConferenceSchedulerState::Ready) {
|
||||
emit CoreManager::getInstance()->getHandlers()->conferenceInfoReceived(mConferenceScheduler->getInfo());
|
||||
if( (mSendInvite & 1) == 1){
|
||||
std::shared_ptr<linphone::ChatRoomParams> params = CoreManager::getInstance()->getCore()->createDefaultChatRoomParams();
|
||||
params->setBackend(linphone::ChatRoomBackend::Basic);
|
||||
|
|
|
|||
|
|
@ -326,5 +326,6 @@ void CoreHandlers::onEcCalibrationResult(
|
|||
|
||||
//------------------------------ CONFERENCE INFO
|
||||
void CoreHandlers::onConferenceInfoReceived(const std::shared_ptr<linphone::Core> & core, const std::shared_ptr<const linphone::ConferenceInfo> & conferenceInfo) {
|
||||
qDebug() << "onConferenceInfoReceived: " << conferenceInfo->getUri()->asString().c_str();
|
||||
emit conferenceInfoReceived(conferenceInfo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,14 +21,23 @@ DialogPlus {
|
|||
property ConferenceInfoModel conferenceInfoModel: ConferenceInfoModel{}
|
||||
onConferenceInfoModelChanged: selectedParticipants.setAddresses(conferenceInfoModel)
|
||||
property int creationState: 0
|
||||
Timer{
|
||||
id: closeDelay
|
||||
interval: 2000
|
||||
onTriggered: conferenceManager.exit(1)
|
||||
}
|
||||
Connections{
|
||||
target: conferenceInfoModel
|
||||
onConferenceCreated: {
|
||||
conferenceManager.creationState = 2
|
||||
if( conferenceInfoModel.inviteMode == 0 ) {
|
||||
closeDelay.start()
|
||||
conferenceManager.creationState = 2
|
||||
}
|
||||
}
|
||||
onConferenceCreationFailed:{ conferenceManager.creationState = -1 }
|
||||
onInvitationsSent: {
|
||||
exit(1)
|
||||
closeDelay.start()
|
||||
conferenceManager.creationState = 2
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -133,7 +142,8 @@ DialogPlus {
|
|||
|
||||
|
||||
conferenceInfoModel.setParticipants(selectedParticipants.participantListModel)
|
||||
conferenceInfoModel.createConference(false && secureSwitch.checked, getInviteMode()) // TODO remove false when Encryption is ready to use
|
||||
conferenceInfoModel.inviteMode = getInviteMode();
|
||||
conferenceInfoModel.createConference(false && secureSwitch.checked) // TODO remove false when Encryption is ready to use
|
||||
}
|
||||
TooltipArea{
|
||||
visible: AccountSettingsModel.conferenceURI == '' || subject.text == '' || selectedParticipants.count < conferenceManager.minParticipants
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue