Add global config in RC to activate chat/video:

[app]
disable_chat_feature=0
disable_video_feature=0
This commit is contained in:
Julien Wadel 2023-11-24 17:25:55 +01:00
parent 4d306fe3aa
commit 19f3823d5a
2 changed files with 11 additions and 4 deletions

View file

@ -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();
}

View file

@ -467,6 +467,7 @@ public:
bool getIncallScreenshotEnabled() const;
void setIncallScreenshotEnabled(const bool& status);
bool getChatEnabled()const;
bool getGroupChatEnabled()const;
bool getConferenceEnabled () const;