Fix trying to connect to irc when no irc is enabled

pull/11/head
Geoffrey Merck 4 years ago
parent 358e753032
commit 8aea19f87c

@ -120,6 +120,7 @@ TConfigValue * CConfig::readKeyAndValue(const std::string s) const
bool CConfig::getValue(const std::string &section, const std::string& key, bool &value, bool defaultValue) const bool CConfig::getValue(const std::string &section, const std::string& key, bool &value, bool defaultValue) const
{ {
value = defaultValue;
std::string valueTemp; std::string valueTemp;
std::string dafaultValueStr = defaultValue ? "true" : "false"; std::string dafaultValueStr = defaultValue ? "true" : "false";
bool ret = getValue(section, key, valueTemp, dafaultValueStr, {"true", "1", "false", "0"}); bool ret = getValue(section, key, valueTemp, dafaultValueStr, {"true", "1", "false", "0"});

@ -206,13 +206,15 @@ bool CDStarGatewayApp::createThread()
CIRCDDB * ircDDB = new CIRCDDBClient(ircDDBConfig.hostname, 9007U, ircDDBConfig.username, ircDDBConfig.password, FULL_PRODUCT_NAME, gatewayConfig.address, ircDDBConfig.isQuadNet); CIRCDDB * ircDDB = new CIRCDDBClient(ircDDBConfig.hostname, 9007U, ircDDBConfig.username, ircDDBConfig.password, FULL_PRODUCT_NAME, gatewayConfig.address, ircDDBConfig.isQuadNet);
clients.push_back(ircDDB); clients.push_back(ircDDB);
} }
CIRCDDBMultiClient* multiClient = new CIRCDDBMultiClient(clients); if(clients.size() > 0U) {
bool res = multiClient->open(); CIRCDDBMultiClient* multiClient = new CIRCDDBMultiClient(clients);
if (!res) { bool res = multiClient->open();
CLog::logInfo("Cannot initialise the ircDDB protocol handler\n"); if (!res) {
return false; CLog::logInfo("Cannot initialise the ircDDB protocol handler\n");
return false;
}
m_thread->setIRC(multiClient);
} }
m_thread->setIRC(multiClient);
// Setup Dextra // Setup Dextra
TDextra dextraConfig; TDextra dextraConfig;

Loading…
Cancel
Save

Powered by TurnKey Linux.