summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAilin Nemui <ailin@devio.us>2018-03-13 11:25:50 +0100
committerAilin Nemui <ailin@devio.us>2018-03-13 11:25:50 +0100
commitcf618d55723e645cfe7865b8a55ec718b1ddd2bb (patch)
treed4e5181868be35605e0efcd1079c75855c130b31 /src
parent9b17a9618769094126edd1f0a9b3ffd4bf7d81ee (diff)
downloadbiboumi-cf618d55723e645cfe7865b8a55ec718b1ddd2bb.tar.gz
biboumi-cf618d55723e645cfe7865b8a55ec718b1ddd2bb.tar.bz2
biboumi-cf618d55723e645cfe7865b8a55ec718b1ddd2bb.tar.xz
biboumi-cf618d55723e645cfe7865b8a55ec718b1ddd2bb.zip
optional identd
Diffstat (limited to 'src')
-rw-r--r--src/main.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/main.cpp b/src/main.cpp
index c877e43..c2b5431 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -135,7 +135,9 @@ int main(int ac, char** av)
std::make_shared<BiboumiComponent>(p, hostname, password);
xmpp_component->start();
- IdentdServer identd(*xmpp_component, p, static_cast<uint16_t>(Config::get_int("identd_port", 113)));
+ std::unique_ptr<IdentdServer> identd;
+ if (Config::get_int("identd_port", 113) != 0)
+ identd = std::make_unique<IdentdServer>(*xmpp_component, p, static_cast<uint16_t>(Config::get_int("identd_port", 113)));
auto timeout = TimedEventsManager::instance().get_timeout();
while (p->poll(timeout) != -1)
@@ -144,7 +146,7 @@ int main(int ac, char** av)
// Check for empty irc_clients (not connected, or with no joined
// channel) and remove them
xmpp_component->clean();
- identd.clean();
+ if (identd) identd->clean();
if (stop)
{
log_info("Signal received, exiting...");
@@ -157,7 +159,7 @@ int main(int ac, char** av)
#ifdef UDNS_FOUND
dns_handler.destroy();
#endif
- identd.shutdown();
+ if (identd) identd->shutdown();
// Cancel the timer for a potential reconnection
TimedEventsManager::instance().cancel("XMPP reconnection");
}
@@ -199,7 +201,7 @@ int main(int ac, char** av)
#ifdef UDNS_FOUND
dns_handler.destroy();
#endif
- identd.shutdown();
+ if (identd) identd->shutdown();
}
}
// If the only existing connection is the one to the XMPP component: