summaryrefslogtreecommitdiff
path: root/src/modules/m_restrictchans.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/m_restrictchans.cpp')
-rw-r--r--src/modules/m_restrictchans.cpp15
1 files changed, 4 insertions, 11 deletions
diff --git a/src/modules/m_restrictchans.cpp b/src/modules/m_restrictchans.cpp
index c76b0e79f..372ee1caa 100644
--- a/src/modules/m_restrictchans.cpp
+++ b/src/modules/m_restrictchans.cpp
@@ -53,30 +53,23 @@ class ModuleRestrictChans : public Module
ReadConfig();
}
-
- virtual ModResult OnUserPreJoin(User* user, Channel* chan, const char* cname, std::string &privs, const std::string &keygiven)
+ ModResult OnUserPreJoin(LocalUser* user, Channel* chan, const std::string& cname, std::string& privs, const std::string& keygiven)
{
- irc::string x = cname;
- if (!IS_LOCAL(user))
- return MOD_RES_PASSTHRU;
+ irc::string x(cname.c_str());
// channel does not yet exist (record is null, about to be created IF we were to allow it)
if (!chan)
{
// user is not an oper and its not in the allow list
- if ((!IS_OPER(user)) && (allowchans.find(x) == allowchans.end()))
+ if ((!user->IsOper()) && (allowchans.find(x) == allowchans.end()))
{
- user->WriteNumeric(ERR_BANNEDFROMCHAN, "%s %s :Only IRC operators may create new channels",user->nick.c_str(),cname);
+ user->WriteNumeric(ERR_BANNEDFROMCHAN, "%s %s :Only IRC operators may create new channels",user->nick.c_str(),cname.c_str());
return MOD_RES_DENY;
}
}
return MOD_RES_PASSTHRU;
}
- virtual ~ModuleRestrictChans()
- {
- }
-
virtual Version GetVersion()
{
return Version("Only opers may create new channels if this module is loaded",VF_VENDOR);