diff --git a/Linphone/core/account/AccountCore.cpp b/Linphone/core/account/AccountCore.cpp index c5f6ab8c3..4f1e6188a 100644 --- a/Linphone/core/account/AccountCore.cpp +++ b/Linphone/core/account/AccountCore.cpp @@ -50,6 +50,7 @@ AccountCore::AccountCore(const std::shared_ptr &account) : QO mIsDefaultAccount = CoreModel::getInstance()->getCore()->getDefaultAccount() == account; mUnreadNotifications = account->getMissedCallsCount() + account->getUnreadChatMessageCount(); mDisplayName = Utils::coreStringToAppString(identityAddress->getDisplayName()); + mPublishEnabled = params->publishEnabled(); if (mDisplayName.isEmpty()) { mDisplayName = ToolModel::getDisplayName(identityAddress); auto copyAddress = identityAddress->clone(); diff --git a/Linphone/core/account/AccountCore.hpp b/Linphone/core/account/AccountCore.hpp index fbfd62f2b..72d794bf6 100644 --- a/Linphone/core/account/AccountCore.hpp +++ b/Linphone/core/account/AccountCore.hpp @@ -84,6 +84,7 @@ public: Q_PROPERTY(LinphoneEnums::Presence explicitPresence MEMBER mExplicitPresence NOTIFY presenceChanged) Q_PROPERTY(QString presenceNote READ getPresenceNote WRITE setPresenceNote NOTIFY presenceChanged) Q_PROPERTY(int maxPresenceNoteSize MEMBER mMaxPresenceNoteSize CONSTANT) + Q_PROPERTY(bool publishEnabled MEMBER mPublishEnabled CONSTANT) DECLARE_CORE_GET(int, voicemailCount, VoicemailCount) static QSharedPointer create(const std::shared_ptr &account); @@ -272,6 +273,7 @@ private: LinphoneEnums::Presence mExplicitPresence; QString mPresenceNote; int mMaxPresenceNoteSize; + bool mPublishEnabled = false; bool mIsSaved = true; diff --git a/Linphone/core/call-history/CallHistoryProxy.cpp b/Linphone/core/call-history/CallHistoryProxy.cpp index 999f4544d..1573e6430 100644 --- a/Linphone/core/call-history/CallHistoryProxy.cpp +++ b/Linphone/core/call-history/CallHistoryProxy.cpp @@ -70,6 +70,6 @@ bool CallHistoryProxy::SortFilterList::filterAcceptsRow(int sourceRow, const QMo bool CallHistoryProxy::SortFilterList::lessThan(const QModelIndex &sourceLeft, const QModelIndex &sourceRight) const { auto l = getItemAtSource(sourceLeft.row()); auto r = getItemAtSource(sourceRight.row()); - - return l->mDate < r->mDate; + if (l && r) return l->mDate < r->mDate; + return false; } diff --git a/Linphone/data/languages/de.ts b/Linphone/data/languages/de.ts index 719868d04..b7175fd8b 100644 --- a/Linphone/data/languages/de.ts +++ b/Linphone/data/languages/de.ts @@ -39,45 +39,45 @@ AccountCore - + drawer_menu_account_connection_status_connected "Connecté" Verbunden - + drawer_menu_account_connection_status_refreshing Aktualisiere… - + drawer_menu_account_connection_status_progress Verbinde… - + drawer_menu_account_connection_status_failed Fehler - + drawer_menu_account_connection_status_cleared Deaktiviert - + manage_account_status_connected_summary "Vous êtes en ligne et joignable." Sie sind online und erreichbar. - + manage_account_status_failed_summary "Erreur de connexion, vérifiez vos paramètres." Verbindungsfehler, überprüfen Sie Ihre Einstellungen. - + manage_account_status_cleared_summary "Compte désactivé, vous ne recevrez ni appel ni message." Konto deaktiviert, Sie erhalten keine Anrufe oder Nachrichten. @@ -2757,19 +2757,19 @@ Stellen Sie sicher, dass Sie keine sensiblen Informationen teilen! Fehler - + information_popup_error_title Erreur Fehler - + information_popup_voicemail_address_undefined_message L'URI de messagerie vocale n'est pas définie. Die Voicemail-URI ist nicht definiert. - + account_settings_name_accessible_name Account settings of %1 Kontoeinstellungen von %1 diff --git a/Linphone/data/languages/en.ts b/Linphone/data/languages/en.ts index e48292dad..ae74ac5b9 100644 --- a/Linphone/data/languages/en.ts +++ b/Linphone/data/languages/en.ts @@ -39,45 +39,45 @@ AccountCore - + drawer_menu_account_connection_status_connected "Connecté" Connected - + drawer_menu_account_connection_status_refreshing Refreshing… - + drawer_menu_account_connection_status_progress Connecting… - + drawer_menu_account_connection_status_failed Error - + drawer_menu_account_connection_status_cleared Disabled - + manage_account_status_connected_summary "Vous êtes en ligne et joignable." You are online and reachable. - + manage_account_status_failed_summary "Erreur de connexion, vérifiez vos paramètres." Connection error, check your settings. - + manage_account_status_cleared_summary "Compte désactivé, vous ne recevrez ni appel ni message." Account disabled, you will not receive calls or messages. @@ -2690,19 +2690,19 @@ Only your correspondent can decrypt them. Contact - + information_popup_error_title Erreur Error - + information_popup_voicemail_address_undefined_message L'URI de messagerie vocale n'est pas définie. The voicemail URI is not defined. - + account_settings_name_accessible_name Account settings of %1 Account settings of %1 diff --git a/Linphone/data/languages/fr.ts b/Linphone/data/languages/fr.ts index c82c56b0a..fdf129ae9 100644 --- a/Linphone/data/languages/fr.ts +++ b/Linphone/data/languages/fr.ts @@ -39,45 +39,45 @@ AccountCore - + drawer_menu_account_connection_status_connected "Connecté" Connecté - + drawer_menu_account_connection_status_refreshing En cours de rafraîchissement… - + drawer_menu_account_connection_status_progress Connexion… - + drawer_menu_account_connection_status_failed Erreur - + drawer_menu_account_connection_status_cleared Désactivé - + manage_account_status_connected_summary "Vous êtes en ligne et joignable." Vous êtes en ligne et joignable. - + manage_account_status_failed_summary "Erreur de connexion, vérifiez vos paramètres." Erreur de connexion, vérifiez vos paramètres. - + manage_account_status_cleared_summary "Compte désactivé, vous ne recevrez ni appel ni message." Compte désactivé, vous ne recevrez ni appel ni message. @@ -2665,19 +2665,19 @@ en bout. Seul votre correspondant peut les déchiffrer. Contact - + information_popup_error_title Erreur Erreur - + information_popup_voicemail_address_undefined_message L'URI de messagerie vocale n'est pas définie. L'URI de messagerie vocale n'est pas définie. - + account_settings_name_accessible_name Account settings of %1 Paramaètres de compte de %1 diff --git a/Linphone/model/account/AccountModel.cpp b/Linphone/model/account/AccountModel.cpp index 2764bb9d5..04b6c763b 100644 --- a/Linphone/model/account/AccountModel.cpp +++ b/Linphone/model/account/AccountModel.cpp @@ -528,6 +528,11 @@ void AccountModel::setPresence(LinphoneEnums::Presence presence, QString presenceNote) { mustBeInLinphoneThread(log().arg(Q_FUNC_INFO)); + if (!mMonitor->getParams()->publishEnabled()) { + lDebug() << log().arg("cannot set presence as publish is disabled in account params, return"); + return; + } + lDebug() << log().arg("presence set request to: " + LinphoneEnums::toString(presence) + " | user initiated? " + (userInitiated ? "true" : "false") + " | reset to auto? " + (resetToAuto ? "true" : "false")); diff --git a/Linphone/view/Control/Display/Contact/Contact.qml b/Linphone/view/Control/Display/Contact/Contact.qml index 9ee7b2349..a256bda69 100644 --- a/Linphone/view/Control/Display/Contact/Contact.qml +++ b/Linphone/view/Control/Display/Contact/Contact.qml @@ -102,6 +102,7 @@ Control.Control{ height: contactStatusPopup.height ContactStatusPopup{ id: contactStatusPopup + visible: mainItem.account.core.publishEnabled } MouseArea { anchors.fill: contactStatusPopup