1
0
Fork 0
mirror of https://git.jami.net/savoirfairelinux/jami-client-qt.git synced 2025-08-03 14:25:38 +02:00

currentCall: receive hideself and hidespectator

GitLab: #919
GitLab: #916
Change-Id: Id511b2194a69959acc2d38f9078f0fd3dd503ee8
This commit is contained in:
Aline Gondim Santos 2022-12-20 10:19:06 -03:00
parent ce6c7dc02b
commit c36ccb5fa9
6 changed files with 19 additions and 22 deletions

View file

@ -47,6 +47,9 @@ class CurrentCall final : public QObject
QML_RO_PROPERTY(bool, isConference)
QML_RO_PROPERTY(bool, isModerator)
QML_PROPERTY(bool, hideSelf)
QML_PROPERTY(bool, hideSpectators)
public:
explicit CurrentCall(LRCInstance* lrcInstance, QObject* parent = nullptr);
~CurrentCall() = default;

View file

@ -56,10 +56,6 @@ class CurrentConversation final : public QObject
QML_PROPERTY(QStringList, backendErrors)
QML_PROPERTY(QString, lastSelfMessageId)
// TODO: these belong in CurrentCall(which doesn't exist yet)
QML_PROPERTY(bool, hideSelf)
QML_PROPERTY(bool, hideSpectators)
public:
explicit CurrentConversation(LRCInstance* lrcInstance, QObject* parent = nullptr);
~CurrentConversation() = default;

View file

@ -179,11 +179,11 @@ Control {
break
case JamiStrings.hideSelf:
UtilsAdapter.setAppValue(Settings.HideSelf, !layoutModel.get(index).ActiveSetting)
CurrentConversation.hideSelf = UtilsAdapter.getAppValue(Settings.HideSelf)
CurrentCall.hideSelf = UtilsAdapter.getAppValue(Settings.HideSelf)
break
case JamiStrings.hideSpectators:
UtilsAdapter.setAppValue(Settings.HideSpectators, !layoutModel.get(index).ActiveSetting)
CurrentConversation.hideSpectators = UtilsAdapter.getAppValue(Settings.HideSpectators)
CurrentCall.hideSpectators = UtilsAdapter.getAppValue(Settings.HideSpectators)
break
}
}

View file

@ -36,11 +36,11 @@ Item {
property int count: 0
property bool inLine: CallParticipantsModel.conferenceLayout === CallParticipantsModel.ONE_WITH_SMALL
property bool participantsSide
property bool enableHideSpectators: CallParticipantsModel.count > 1 && CurrentConversation.hideSpectators
property bool enableHideSpectators: CallParticipantsModel.count > 1 && CurrentCall.hideSpectators
onVisibleChanged: {
CurrentConversation.hideSelf = UtilsAdapter.getAppValue(Settings.HideSelf)
CurrentConversation.hideSpectators = UtilsAdapter.getAppValue(Settings.HideSpectators)
CurrentCall.hideSelf = UtilsAdapter.getAppValue(Settings.HideSelf)
CurrentCall.hideSpectators = UtilsAdapter.getAppValue(Settings.HideSpectators)
}
Component {
@ -92,7 +92,7 @@ Item {
ValueFilter { roleName: "Active"; value: false }
ValueFilter {
enabled: CallParticipantsModel.count > 1 &&
CurrentConversation.hideSelf
CurrentCall.hideSelf
roleName: "IsLocal"
value: false
}

View file

@ -505,11 +505,6 @@ AccountModelPimpl::updateAccountDetails(account::Info& accountInfo)
}
accountInfo.confProperties.credentials.swap(credToStore);
MapStringString volatileDetails = ConfigurationManager::instance().getVolatileAccountDetails(
accountInfo.id);
QString daemonStatus = volatileDetails[libjami::Account::ConfProperties::Registration::STATUS];
accountInfo.status = lrc::api::account::to_status(daemonStatus);
}
account::Info&
@ -598,6 +593,11 @@ AccountModelPimpl::slotVolatileAccountDetailsChanged(const QString& accountId,
if (new_usernameIt == details.end())
return;
accountInfo.registeredName = new_usernameIt.value();
auto new_deviceId = details.find(libjami::Account::ConfProperties::DEVICE_ID);
if (new_deviceId != details.end())
accountInfo.confProperties.deviceId = new_deviceId.value();
Q_EMIT linked.profileUpdated(accountId);
}
@ -695,11 +695,6 @@ AccountModelPimpl::slotMigrationEnded(const QString& accountId, bool ok)
auto& accountInfo = it->second.first;
MapStringString details = ConfigurationManager::instance().getAccountDetails(accountId);
accountInfo.fromDetails(details);
MapStringString volatileDetails = ConfigurationManager::instance().getVolatileAccountDetails(
accountId);
QString daemonStatus
= volatileDetails[libjami::Account::ConfProperties::Registration::STATUS];
accountInfo.status = lrc::api::account::to_status(daemonStatus);
}
Q_EMIT linked.migrationEnded(accountId, ok);
}
@ -827,6 +822,8 @@ account::Info::fromDetails(const MapStringString& details)
: "";
profileInfo.alias = details[ConfProperties::DISPLAYNAME];
enabled = toBool(details[ConfProperties::ENABLED]);
status = lrc::api::account::to_status(
volatileDetails[libjami::Account::ConfProperties::Registration::STATUS]);
confProperties.mailbox = details[ConfProperties::MAILBOX];
confProperties.dtmfType = details[ConfProperties::DTMF_TYPE];
confProperties.autoAnswer = toBool(details[ConfProperties::AUTOANSWER]);
@ -843,7 +840,7 @@ account::Info::fromDetails(const MapStringString& details)
confProperties.password = details[ConfProperties::PASSWORD];
confProperties.realm = details[ConfProperties::REALM];
confProperties.localInterface = details[ConfProperties::LOCAL_INTERFACE];
confProperties.deviceId = details[ConfProperties::DEVICE_ID];
confProperties.deviceId = volatileDetails[ConfProperties::DEVICE_ID];
confProperties.deviceName = details[ConfProperties::DEVICE_NAME];
confProperties.publishedSameAsLocal = toBool(details[ConfProperties::PUBLISHED_SAMEAS_LOCAL]);
confProperties.localPort = toInt(details[ConfProperties::LOCAL_PORT]);

View file

@ -122,7 +122,7 @@ DeviceModelPimpl::DeviceModelPimpl(const DeviceModel& linked,
, callbacksHandler(callbacksHandler)
, devices_({})
{
const MapStringString aDetails = ConfigurationManager::instance().getAccountDetails(
const MapStringString aDetails = ConfigurationManager::instance().getVolatileAccountDetails(
linked.owner.id);
currentDeviceId_ = aDetails.value(libjami::Account::ConfProperties::DEVICE_ID);
const MapStringString accountDevices = ConfigurationManager::instance().getKnownRingDevices(
@ -135,6 +135,7 @@ DeviceModelPimpl::DeviceModelPimpl(const DeviceModel& linked,
/* name= */ it.value(),
/* isCurrent= */ it.key() == currentDeviceId_};
if (device.isCurrent) {
currentDeviceId_ = it.key();
devices_.push_back(device);
} else {
devices_.push_back(device);