From 9781579ae57aed0988f4bf677ef602916feb3bce Mon Sep 17 00:00:00 2001 From: Attila Molnar Date: Thu, 30 Jan 2014 22:14:33 +0100 Subject: m_conn_join Read default settings in ReadConfig() --- src/modules/m_conn_join.cpp | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/modules/m_conn_join.cpp b/src/modules/m_conn_join.cpp index cbe8b0be3..a5aba68df 100644 --- a/src/modules/m_conn_join.cpp +++ b/src/modules/m_conn_join.cpp @@ -62,12 +62,21 @@ class JoinTimer : public Timer class ModuleConnJoin : public Module { SimpleExtItem ext; + std::string defchans; + unsigned int defdelay; public: ModuleConnJoin() : ext("join_timer", this) { } + void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE + { + ConfigTag* tag = ServerInstance->Config->ConfValue("autojoin"); + defchans = tag->getString("channel"); + defdelay = tag->getInt("delay", 0, 0, 60); + } + void Prioritize() { ServerInstance->Modules->SetPriority(this, I_OnPostConnect, PRIORITY_LAST); @@ -89,14 +98,12 @@ class ModuleConnJoin : public Module if (chanlist.empty()) { - ConfigTag* tag = ServerInstance->Config->ConfValue("autojoin"); - chanlist = tag->getString("channel"); - chandelay = tag->getInt("delay", 0, 0, 60); + if (defchans.empty()) + return; + chanlist = defchans; + chandelay = defdelay; } - if (chanlist.empty()) - return; - if (!chandelay) JoinChannels(localuser, chanlist); else -- cgit v1.2.3