Fix conference info synchronization on edition/cancellation.

Design ICS invitation for updated/cancelled conference.
This commit is contained in:
Julien Wadel 2022-08-30 17:55:04 +02:00
parent fa1d54242b
commit db10f40445
23 changed files with 216 additions and 5 deletions

View file

@ -555,6 +555,16 @@ Server url ikke konfigureret.</translation>
<numerusform></numerusform>
</translation>
</message>
<message>
<source>icsUpdatedMeetingInvite</source>
<extracomment>&apos;Meeting has been cancelled&apos; : ICS title for a cancelled invitation.</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>icsCancelledMeetingInvite</source>
<extracomment>&apos;Meeting has been updated&apos; : ICS title for an updated invitation.</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ChatDeliveries</name>

View file

@ -555,6 +555,16 @@ Server URL ist nicht konfiguriert.</translation>
<numerusform></numerusform>
</translation>
</message>
<message>
<source>icsUpdatedMeetingInvite</source>
<extracomment>&apos;Meeting has been cancelled&apos; : ICS title for a cancelled invitation.</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>icsCancelledMeetingInvite</source>
<extracomment>&apos;Meeting has been updated&apos; : ICS title for an updated invitation.</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ChatDeliveries</name>

View file

@ -555,6 +555,16 @@ Server URL not configured.</translation>
<numerusform>%1 participants</numerusform>
</translation>
</message>
<message>
<source>icsUpdatedMeetingInvite</source>
<extracomment>&apos;Meeting has been cancelled&apos; : ICS title for a cancelled invitation.</extracomment>
<translation>Meeting has been cancelled</translation>
</message>
<message>
<source>icsCancelledMeetingInvite</source>
<extracomment>&apos;Meeting has been updated&apos; : ICS title for an updated invitation.</extracomment>
<translation>Meeting has been updated</translation>
</message>
</context>
<context>
<name>ChatDeliveries</name>

View file

@ -555,6 +555,16 @@ URL del servidor no configurada.</translation>
<numerusform></numerusform>
</translation>
</message>
<message>
<source>icsUpdatedMeetingInvite</source>
<extracomment>&apos;Meeting has been cancelled&apos; : ICS title for a cancelled invitation.</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>icsCancelledMeetingInvite</source>
<extracomment>&apos;Meeting has been updated&apos; : ICS title for an updated invitation.</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ChatDeliveries</name>

View file

@ -555,6 +555,16 @@ URL du serveur non configurée.</translation>
<numerusform></numerusform>
</translation>
</message>
<message>
<source>icsUpdatedMeetingInvite</source>
<extracomment>&apos;Meeting has been cancelled&apos; : ICS title for a cancelled invitation.</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>icsCancelledMeetingInvite</source>
<extracomment>&apos;Meeting has been updated&apos; : ICS title for an updated invitation.</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ChatDeliveries</name>

View file

@ -553,6 +553,16 @@ A kiszolgáló URL-je nincs konfigurálva.</translation>
<numerusform></numerusform>
</translation>
</message>
<message>
<source>icsUpdatedMeetingInvite</source>
<extracomment>&apos;Meeting has been cancelled&apos; : ICS title for a cancelled invitation.</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>icsCancelledMeetingInvite</source>
<extracomment>&apos;Meeting has been updated&apos; : ICS title for an updated invitation.</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ChatDeliveries</name>

View file

@ -555,6 +555,16 @@ URL del server non configurato.</translation>
<numerusform></numerusform>
</translation>
</message>
<message>
<source>icsUpdatedMeetingInvite</source>
<extracomment>&apos;Meeting has been cancelled&apos; : ICS title for a cancelled invitation.</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>icsCancelledMeetingInvite</source>
<extracomment>&apos;Meeting has been updated&apos; : ICS title for an updated invitation.</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ChatDeliveries</name>

View file

@ -553,6 +553,16 @@
<numerusform></numerusform>
</translation>
</message>
<message>
<source>icsUpdatedMeetingInvite</source>
<extracomment>&apos;Meeting has been cancelled&apos; : ICS title for a cancelled invitation.</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>icsCancelledMeetingInvite</source>
<extracomment>&apos;Meeting has been updated&apos; : ICS title for an updated invitation.</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ChatDeliveries</name>

View file

@ -557,6 +557,16 @@ Nesukonfigūruotas serverio url.</translation>
<numerusform></numerusform>
</translation>
</message>
<message>
<source>icsUpdatedMeetingInvite</source>
<extracomment>&apos;Meeting has been cancelled&apos; : ICS title for a cancelled invitation.</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>icsCancelledMeetingInvite</source>
<extracomment>&apos;Meeting has been updated&apos; : ICS title for an updated invitation.</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ChatDeliveries</name>

View file

@ -555,6 +555,16 @@ URL do servidor não configurado.</translation>
<numerusform></numerusform>
</translation>
</message>
<message>
<source>icsUpdatedMeetingInvite</source>
<extracomment>&apos;Meeting has been cancelled&apos; : ICS title for a cancelled invitation.</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>icsCancelledMeetingInvite</source>
<extracomment>&apos;Meeting has been updated&apos; : ICS title for an updated invitation.</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ChatDeliveries</name>

View file

@ -557,6 +557,16 @@
<numerusform></numerusform>
</translation>
</message>
<message>
<source>icsUpdatedMeetingInvite</source>
<extracomment>&apos;Meeting has been cancelled&apos; : ICS title for a cancelled invitation.</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>icsCancelledMeetingInvite</source>
<extracomment>&apos;Meeting has been updated&apos; : ICS title for an updated invitation.</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ChatDeliveries</name>

View file

@ -555,6 +555,16 @@ Serverwebbadressen är inte konfigurerad.</translation>
<numerusform></numerusform>
</translation>
</message>
<message>
<source>icsUpdatedMeetingInvite</source>
<extracomment>&apos;Meeting has been cancelled&apos; : ICS title for a cancelled invitation.</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>icsCancelledMeetingInvite</source>
<extracomment>&apos;Meeting has been updated&apos; : ICS title for an updated invitation.</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ChatDeliveries</name>

View file

@ -553,6 +553,16 @@ Sunucu url&apos;si yapılandırılmadı.</translation>
<numerusform></numerusform>
</translation>
</message>
<message>
<source>icsUpdatedMeetingInvite</source>
<extracomment>&apos;Meeting has been cancelled&apos; : ICS title for a cancelled invitation.</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>icsCancelledMeetingInvite</source>
<extracomment>&apos;Meeting has been updated&apos; : ICS title for an updated invitation.</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ChatDeliveries</name>

View file

@ -557,6 +557,16 @@
<numerusform></numerusform>
</translation>
</message>
<message>
<source>icsUpdatedMeetingInvite</source>
<extracomment>&apos;Meeting has been cancelled&apos; : ICS title for a cancelled invitation.</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>icsCancelledMeetingInvite</source>
<extracomment>&apos;Meeting has been updated&apos; : ICS title for an updated invitation.</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ChatDeliveries</name>

View file

@ -553,6 +553,16 @@
<numerusform></numerusform>
</translation>
</message>
<message>
<source>icsUpdatedMeetingInvite</source>
<extracomment>&apos;Meeting has been cancelled&apos; : ICS title for a cancelled invitation.</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<source>icsCancelledMeetingInvite</source>
<extracomment>&apos;Meeting has been updated&apos; : ICS title for an updated invitation.</extracomment>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ChatDeliveries</name>

View file

@ -97,8 +97,9 @@ QSharedPointer<ConferenceInfoModel> ConferenceInfoListModel::get(std::shared_ptr
auto model = item.objectCast<ConferenceInfoModel>();
auto dbConferenceInfo = model->getConferenceInfo();
if(dbConferenceInfo == conferenceInfo
|| dbConferenceInfo->getUri()->weakEqual(uri))
|| dbConferenceInfo->getUri()->equal(uri)){
return model;
}
}
return nullptr;
}

View file

@ -103,6 +103,7 @@ ConferenceInfoModel::ConferenceInfoModel (QObject * parent) : QObject(parent){
connect(this, &ConferenceInfoModel::conferenceInfoChanged, this, &ConferenceInfoModel::uriChanged);// Useless but just in case.
connect(this, &ConferenceInfoModel::conferenceInfoChanged, this, &ConferenceInfoModel::isScheduledChanged);
connect(this, &ConferenceInfoModel::conferenceInfoChanged, this, &ConferenceInfoModel::inviteModeChanged);
connect(this, &ConferenceInfoModel::conferenceInfoChanged, this, &ConferenceInfoModel::conferenceInfoStateChanged);
}
// Callable from C++
@ -111,6 +112,18 @@ ConferenceInfoModel::ConferenceInfoModel (std::shared_ptr<linphone::ConferenceIn
mTimeZone = QTimeZone::systemTimeZone();
mConferenceInfo = conferenceInfo;
mIsScheduled = (mConferenceInfo->getDateTime() != 0 || mConferenceInfo->getDuration() != 0);
connect(this, &ConferenceInfoModel::conferenceInfoChanged, this, &ConferenceInfoModel::timeZoneModelChanged);
connect(this, &ConferenceInfoModel::conferenceInfoChanged, this, &ConferenceInfoModel::dateTimeChanged);
connect(this, &ConferenceInfoModel::conferenceInfoChanged, this, &ConferenceInfoModel::durationChanged);
connect(this, &ConferenceInfoModel::conferenceInfoChanged, this, &ConferenceInfoModel::organizerChanged);
connect(this, &ConferenceInfoModel::conferenceInfoChanged, this, &ConferenceInfoModel::subjectChanged);
connect(this, &ConferenceInfoModel::conferenceInfoChanged, this, &ConferenceInfoModel::descriptionChanged);
connect(this, &ConferenceInfoModel::conferenceInfoChanged, this, &ConferenceInfoModel::participantsChanged);
connect(this, &ConferenceInfoModel::conferenceInfoChanged, this, &ConferenceInfoModel::uriChanged);// Useless but just in case.
connect(this, &ConferenceInfoModel::conferenceInfoChanged, this, &ConferenceInfoModel::isScheduledChanged);
connect(this, &ConferenceInfoModel::conferenceInfoChanged, this, &ConferenceInfoModel::inviteModeChanged);
connect(this, &ConferenceInfoModel::conferenceInfoChanged, this, &ConferenceInfoModel::conferenceInfoStateChanged);
}
ConferenceInfoModel::~ConferenceInfoModel () {
@ -206,6 +219,10 @@ QString ConferenceInfoModel::getIcalendarString() const{
return Utils::coreStringToAppString(mConferenceInfo->getIcalendarString());
}
LinphoneEnums::ConferenceInfoState ConferenceInfoModel::getConferenceInfoState() const{
return LinphoneEnums::fromLinphone(mConferenceInfo->getState());
}
//------------------------------------------------------------------------------------------------
// Convert into UTC with TimeZone and pass system timezone to conference info
void ConferenceInfoModel::setDateTime(const QDateTime& dateTime){

View file

@ -27,6 +27,8 @@
#include <QSharedPointer>
#include <QTimeZone>
#include "utils/LinphoneEnums.hpp"
class ParticipantListModel;
class ConferenceScheduler;
class TimeZoneModel;
@ -47,6 +49,7 @@ public:
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)
Q_PROPERTY(LinphoneEnums::ConferenceInfoState state READ getConferenceInfoState NOTIFY conferenceInfoStateChanged)
static QSharedPointer<ConferenceInfoModel> create(std::shared_ptr<linphone::ConferenceInfo> conferenceInfo);
ConferenceInfoModel (QObject * parent = nullptr);
@ -72,6 +75,7 @@ public:
Q_INVOKABLE int getParticipantCount()const;
Q_INVOKABLE TimeZoneModel* getTimeZoneModel() const;
Q_INVOKABLE QString getIcalendarString() const;
LinphoneEnums::ConferenceInfoState getConferenceInfoState() const;
void setDateTime(const QDateTime& dateTime);
void setDuration(const int& duration);
@ -106,6 +110,7 @@ signals:
void uriChanged();
void isScheduledChanged();
void inviteModeChanged();
void conferenceInfoStateChanged();
void conferenceCreated();
void conferenceCreationFailed();

View file

@ -147,6 +147,9 @@ class ColorListModel : public ProxyListModel {
ADD_COLOR("incall_message_banner_bg", "#FC4607", "Incall message banner background")
ADD_COLOR("incall_message_banner_fg", "#FFFFFF", "Incall message banner foreground")
ADD_COLOR_WITH_LINK("ics_fg", "", "Special text color for ICS", "j")
ADD_COLOR("updated_ics_fg", "#EFAE00", "Special text color for updated ICS")
ADD_COLOR("cancelled_ics_fg", "#FF0000", "Special text color for cancelled ICS")
// Keywords: 'mKeywordsMap'
// s=standard, ma=main, l=list, sc=screen, me=menu

View file

@ -78,6 +78,14 @@ LinphoneEnums::ConferenceLayout LinphoneEnums::fromLinphone(const linphone::Conf
return static_cast<LinphoneEnums::ConferenceLayout>(layout);
}
linphone::ConferenceInfoState LinphoneEnums::toLinphone(const LinphoneEnums::ConferenceInfoState& state){
return static_cast<linphone::ConferenceInfoState>(state);
}
LinphoneEnums::ConferenceInfoState LinphoneEnums::fromLinphone(const linphone::ConferenceInfoState& state){
return static_cast<LinphoneEnums::ConferenceInfoState>(state);
}
linphone::ParticipantDeviceState LinphoneEnums::toLinphone(const LinphoneEnums::ParticipantDeviceState& state){
return static_cast<linphone::ParticipantDeviceState>(state);
}

View file

@ -121,6 +121,18 @@ Q_ENUM_NS(ConferenceLayout)
linphone::ConferenceLayout toLinphone(const LinphoneEnums::ConferenceLayout& layout);
LinphoneEnums::ConferenceLayout fromLinphone(const linphone::ConferenceLayout& layout);
enum ConferenceInfoState {
ConferenceInfoStateNew = int(linphone::ConferenceInfoState::New),
ConferenceInfoStateUpdated = int(linphone::ConferenceInfoState::Updated),
ConferenceInfoStateCancelled = int(linphone::ConferenceInfoState::Cancelled)
};
Q_ENUM_NS(ConferenceInfoState)
linphone::ConferenceInfoState toLinphone(const LinphoneEnums::ConferenceInfoState& state);
LinphoneEnums::ConferenceInfoState fromLinphone(const linphone::ConferenceInfoState& state);
enum ParticipantDeviceState {
ParticipantDeviceStateJoining = int(linphone::ParticipantDeviceState::Joining),
ParticipantDeviceStatePresent = int(linphone::ParticipantDeviceState::Present),

View file

@ -68,20 +68,33 @@ Loader{
onMinHeightChanged: Qt.callLater( layout.updateFitHeight)
property int fitHeight: 0
property int fitWidth: Math.max(shareButton.width + joinButton.width, description.fitWidth)
property int fitWidth: Math.max(titleItem.implicitWidth, Math.max(shareButton.width + joinButton.width, description.fitWidth))
anchors.fill: parent
spacing: 0
Text{
id: titleItem
Layout.fillWidth: true
Layout.topMargin: 5
Layout.leftMargin: 5
Layout.alignment: Qt.AlignRight
elide: Text.ElideRight
color: ChatCalendarMessageStyle.type.color
color: mainItem.conferenceInfoModel.state == LinphoneEnums.ConferenceInfoStateUpdated
? ChatCalendarMessageStyle.type.updatedColor
: mainItem.conferenceInfoModel.state == LinphoneEnums.ConferenceInfoStateCancelled
? ChatCalendarMessageStyle.type.cancelledColor
: ChatCalendarMessageStyle.type.color
font.pointSize: ChatCalendarMessageStyle.type.pointSize
font.weight: Font.Bold
text: (mainItem.conferenceInfoModel.state == LinphoneEnums.ConferenceInfoStateUpdated
//: 'Meeting has been cancelled' : ICS title for a cancelled invitation.
? qsTr('icsUpdatedMeetingInvite')
: mainItem.conferenceInfoModel.state == LinphoneEnums.ConferenceInfoStateCancelled
//: 'Meeting has been updated' : ICS title for an updated invitation.
? qsTr('icsCancelledMeetingInvite')
//: 'Meeting invite' : ICS title that is an invitation.
text: qsTr('icsMeetingInvite') +': '// + UtilsCpp.getDisplayName(mainItem.conferenceInfoModel.organizer)
: qsTr('icsMeetingInvite')
) +': '// + UtilsCpp.getDisplayName(mainItem.conferenceInfoModel.organizer)
}
Text{
id: title

View file

@ -56,7 +56,9 @@ QtObject {
property QtObject type: QtObject {
property int spacing: 5
property int pointSize: Units.dp * 10
property color color: ColorsList.add(sectionName+'_subject', 'j').color
property color updatedColor: ColorsList.add(sectionName+'_updated_subject', 'updated_ics_fg').color
property color cancelledColor: ColorsList.add(sectionName+'_cancelled_subject', 'cancelled_ics_fg').color
property color color: ColorsList.add(sectionName+'_subject', 'ics_fg').color
}
property QtObject subject: QtObject {
property int spacing: 5