summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2014-01-30 22:14:33 +0100
committerAttila Molnar <attilamolnar@hush.com>2014-01-30 22:14:33 +0100
commit9781579ae57aed0988f4bf677ef602916feb3bce (patch)
treed14f2c4fa6c524041b10b708233f556c8d710918 /src
parent9e1399c12824e759f605dca601621159a5be618c (diff)
m_conn_join Read default settings in ReadConfig()
Diffstat (limited to 'src')
-rw-r--r--src/modules/m_conn_join.cpp19
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