diff --git a/linphone-app/src/components/settings/SettingsModel.cpp b/linphone-app/src/components/settings/SettingsModel.cpp index 2b82f638a..7d0d00815 100644 --- a/linphone-app/src/components/settings/SettingsModel.cpp +++ b/linphone-app/src/components/settings/SettingsModel.cpp @@ -657,12 +657,13 @@ void SettingsModel::setVideoDefinition (const QVariantMap &definition) { } bool SettingsModel::getVideoEnabled() const { - return CoreManager::getInstance()->getCore()->videoSupported() && !!mConfig->getInt(UiSection, "video_enabled", 1); + return CoreManager::getInstance()->getCore()->videoSupported() + && !mConfig->getInt("app", "disable_video_feature", !mConfig->getInt(UiSection, "video_enabled", 1)); } void SettingsModel::setVideoEnabled(const bool& enable){ if( CoreManager::getInstance()->getCore()->videoSupported()){ - mConfig->setInt(UiSection, "video_enabled", enable); + mConfig->setInt("app", "disable_video_feature", !enable); emit videoEnabledChanged(); } } @@ -894,8 +895,9 @@ void SettingsModel::setMuteMicrophoneEnabled (bool status) { // ----------------------------------------------------------------------------- + bool SettingsModel::getStandardChatEnabled () const { - return !!mConfig->getInt(UiSection, getEntryFullName(UiSection,"standard_chat_enabled"), 1); + return getChatEnabled() && !!mConfig->getInt(UiSection, getEntryFullName(UiSection,"standard_chat_enabled"), 1); } void SettingsModel::setStandardChatEnabled (bool status) { @@ -905,7 +907,7 @@ void SettingsModel::setStandardChatEnabled (bool status) { } bool SettingsModel::getSecureChatEnabled () const { - return !!mConfig->getInt(UiSection, getEntryFullName(UiSection, "secure_chat_enabled"), 1) + return getChatEnabled() && !!mConfig->getInt(UiSection, getEntryFullName(UiSection, "secure_chat_enabled"), 1) && getLimeIsSupported() && CoreManager::getInstance()->getCore()->getDefaultAccount() && !CoreManager::getInstance()->getCore()->getDefaultAccount()->getParams()->getLimeServerUrl().empty() //&& !CoreManager::getInstance()->getCore()->getLimeX3DhServerUrl().empty() @@ -919,6 +921,10 @@ void SettingsModel::setSecureChatEnabled (bool status) { emit secureChatEnabledChanged(); } +bool SettingsModel::getChatEnabled () const { + return !mConfig->getInt("app", getEntryFullName("app","disable_chat_feature"), 0); +} + bool SettingsModel::getGroupChatEnabled() const{ return CoreManager::getInstance()->getCore()->getDefaultAccount() && !CoreManager::getInstance()->getCore()->getDefaultAccount()->getParams()->getConferenceFactoryUri().empty(); } diff --git a/linphone-app/src/components/settings/SettingsModel.hpp b/linphone-app/src/components/settings/SettingsModel.hpp index 0b7e55689..493fdca0b 100644 --- a/linphone-app/src/components/settings/SettingsModel.hpp +++ b/linphone-app/src/components/settings/SettingsModel.hpp @@ -467,6 +467,7 @@ public: bool getIncallScreenshotEnabled() const; void setIncallScreenshotEnabled(const bool& status); + bool getChatEnabled()const; bool getGroupChatEnabled()const; bool getConferenceEnabled () const;