diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/modules/m_conn_join.cpp | 19 |
1 files 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<JoinTimer> 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 |