diff --git a/src/app/currentcall.h b/src/app/currentcall.h index c04a65fc..c6c70b9b 100644 --- a/src/app/currentcall.h +++ b/src/app/currentcall.h @@ -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; diff --git a/src/app/currentconversation.h b/src/app/currentconversation.h index 99d6ae65..a3c9d817 100644 --- a/src/app/currentconversation.h +++ b/src/app/currentconversation.h @@ -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; diff --git a/src/app/mainview/components/CallActionBar.qml b/src/app/mainview/components/CallActionBar.qml index 04c8a49b..62fff410 100644 --- a/src/app/mainview/components/CallActionBar.qml +++ b/src/app/mainview/components/CallActionBar.qml @@ -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 } } diff --git a/src/app/mainview/components/ParticipantsLayer.qml b/src/app/mainview/components/ParticipantsLayer.qml index 89f11a46..fa17aecc 100644 --- a/src/app/mainview/components/ParticipantsLayer.qml +++ b/src/app/mainview/components/ParticipantsLayer.qml @@ -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 } diff --git a/src/libclient/accountmodel.cpp b/src/libclient/accountmodel.cpp index e70c38a1..928bb5bf 100644 --- a/src/libclient/accountmodel.cpp +++ b/src/libclient/accountmodel.cpp @@ -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]); diff --git a/src/libclient/devicemodel.cpp b/src/libclient/devicemodel.cpp index c0423faa..fd121cff 100644 --- a/src/libclient/devicemodel.cpp +++ b/src/libclient/devicemodel.cpp @@ -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);