summaryrefslogtreecommitdiff
path: root/src/modules/m_ojoin.cpp
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2010-02-07 23:18:53 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2010-02-07 23:18:53 +0000
commit934a3f296f087ae35fb072ede04b0ffdfd695b71 (patch)
tree906ab789d418690b98fb9f954b6a087faa854b9c /src/modules/m_ojoin.cpp
parentf91f6495f4830ebca44df0f695caf84308fb46e1 (diff)
Fix crash on kick when +J is set, +misc cleanup
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12396 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_ojoin.cpp')
-rw-r--r--src/modules/m_ojoin.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/modules/m_ojoin.cpp b/src/modules/m_ojoin.cpp
index 38497f1bb..17c52710a 100644
--- a/src/modules/m_ojoin.cpp
+++ b/src/modules/m_ojoin.cpp
@@ -98,7 +98,7 @@ class NetworkPrefix : public ModeHandler
{
list = true;
prefix = NPrefix;
- levelrequired = 0xFFFFFFFF;
+ levelrequired = INT_MAX;
m_paramtype = TR_NICK;
}
@@ -200,27 +200,24 @@ class ModuleOjoin : public Module
void OnRehash(User* user)
{
- ConfigReader Conf;
+ ConfigTag* Conf = ServerInstance->Config->ConvValue("ojoin");
if (!np)
{
// This is done on module load only
- std::string npre = Conf.ReadValue("ojoin", "prefix", 0);
+ std::string npre = Conf->getString("prefix");
NPrefix = npre.empty() ? 0 : npre[0];
if (NPrefix && ServerInstance->Modes->FindPrefix(NPrefix))
throw ModuleException("Looks like the +Y prefix you picked for m_ojoin is already in use. Pick another.");
}
- notice = Conf.ReadFlag("ojoin", "notice", "yes", 0);
- op = Conf.ReadFlag("ojoin", "op", "yes", 0);
+ notice = Conf->getBool("notice", true);
+ op = Conf->getBool("op", true);
}
ModResult OnUserPreKick(User* source, Membership* memb, const std::string &reason)
{
- if ((ServerInstance->ULine(source->nick.c_str())) || ServerInstance->ULine(source->server))
- return MOD_RES_PASSTHRU;
-
// Don't do anything if they're not +Y
if (!memb->hasMode('Y'))
return MOD_RES_PASSTHRU;