Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/SpectrumIM/spectrum2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVitaly Takmazov <vitalyster@gmail.com>2022-01-20 11:45:04 +0300
committerVitaly Takmazov <vitalyster@gmail.com>2022-01-20 11:45:04 +0300
commitdf53f4d95affad9fb95007ac4471b4831ec67a04 (patch)
treebcf5ad61e35a2d4c1b8409f896f6da041de657b0 /spectrum
parent6ba1ee85b7e0d19c358031cefad5a474115108a0 (diff)
Config: process all unknown options as stringsconfig_strings
* remove CONFIG_LIST* macros as they were used only for unknown options, CONFIG_VECTOR still used for registered options
Diffstat (limited to 'spectrum')
-rw-r--r--spectrum/src/frontends/xmpp/adhocmanager.cpp3
-rw-r--r--spectrum/src/frontends/xmpp/settingsadhoccommand.cpp4
2 files changed, 2 insertions, 5 deletions
diff --git a/spectrum/src/frontends/xmpp/adhocmanager.cpp b/spectrum/src/frontends/xmpp/adhocmanager.cpp
index 50598d27..86f07144 100644
--- a/spectrum/src/frontends/xmpp/adhocmanager.cpp
+++ b/spectrum/src/frontends/xmpp/adhocmanager.cpp
@@ -73,9 +73,6 @@ void AdHocManager::handleUserCreated(User *user) {
for (std::map<std::string, AdHocCommandFactory *>::const_iterator it = m_factories.begin(); it != m_factories.end(); it++) {
for (std::map<std::string, std::string>::const_iterator it2 = it->second->getUserSettings().begin(); it2 != it->second->getUserSettings().end(); it2++) {
std::string value = CONFIG_STRING_DEFAULTED(m_component->getConfig(), it->second->getNode() + "." + it2->first, it2->second);
- if (it2->second == "true" || it2->second == "1" || it2->second == "false" || it2->second == "0") {
- value = CONFIG_BOOL_DEFAULTED(m_component->getConfig(), it->second->getNode() + "." + it2->first, it2->second == "true" || it2->second == "1") ? "1" : "0";
- }
if (m_storageBackend) {
int type = (int) TYPE_BOOLEAN;
m_storageBackend->getUserSetting(user->getUserInfo().id, it2->first, type, value);
diff --git a/spectrum/src/frontends/xmpp/settingsadhoccommand.cpp b/spectrum/src/frontends/xmpp/settingsadhoccommand.cpp
index 9e05c2f8..2a7532d3 100644
--- a/spectrum/src/frontends/xmpp/settingsadhoccommand.cpp
+++ b/spectrum/src/frontends/xmpp/settingsadhoccommand.cpp
@@ -67,11 +67,11 @@ std::shared_ptr<Swift::Command> SettingsAdHocCommand::getForm() {
m_storageBackend->getUserSetting(user.id, "enable_transport", type, value);
FormUtils::addBooleanField(form, "enable_transport", value, "Enable transport");
- value = CONFIG_BOOL_DEFAULTED(m_component->getConfig(), "settings.send_headlines", false) ? "1" : "0";
+ value = CONFIG_STRING_DEFAULTED(m_component->getConfig(), "settings.send_headlines", "0");
m_storageBackend->getUserSetting(user.id, "send_headlines", type, value);
FormUtils::addBooleanField(form, "send_headlines", value, "Allow sending messages as headlines");
- value = CONFIG_BOOL_DEFAULTED(m_component->getConfig(), "settings.stay_connected", false) ? "1" : "0";
+ value = CONFIG_STRING_DEFAULTED(m_component->getConfig(), "settings.stay_connected", "0");
m_storageBackend->getUserSetting(user.id, "stay_connected", type, value);
FormUtils::addBooleanField(form, "stay_connected", value, "Stay connected to legacy network when offline on XMPP");