]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_ojoin.cpp
Some more text fixes and improvements (#1618).
[user/henk/code/inspircd.git] / src / modules / m_ojoin.cpp
index 56cef10b4ed3f8ae533df791a238055a97ee2ec3..c0626ec695357189dd4e4f6e343259176fe35349 100644 (file)
@@ -34,11 +34,11 @@ class CommandOjoin : public SplitCommand
                : SplitCommand(parent, "OJOIN", 1)
                , npmh(&mode)
        {
-               flags_needed = 'o'; Penalty = 0; syntax = "<channel>";
+               flags_needed = 'o'; syntax = "<channel>";
                active = false;
        }
 
-       CmdResult HandleLocal(const std::vector<std::string>& parameters, LocalUser* user)
+       CmdResult HandleLocal(LocalUser* user, const Params& parameters) CXX11_OVERRIDE
        {
                // Make sure the channel name is allowable.
                if (!ServerInstance->IsChannel(parameters[0]))
@@ -89,10 +89,10 @@ class NetworkPrefix : public PrefixMode
        NetworkPrefix(Module* parent, char NPrefix)
                : PrefixMode(parent, "official-join", 'Y', NETWORK_VALUE, NPrefix)
        {
-               levelrequired = INT_MAX;
+               ranktoset = ranktounset = UINT_MAX;
        }
 
-       ModResult AccessCheck(User* source, Channel* channel, std::string &parameter, bool adding)
+       ModResult AccessCheck(User* source, Channel* channel, std::string &parameter, bool adding) CXX11_OVERRIDE
        {
                User* theuser = ServerInstance->FindNick(parameter);
                // remove own privs?
@@ -139,7 +139,7 @@ class ModuleOjoin : public Module
        ModResult OnUserPreKick(User* source, Membership* memb, const std::string &reason) CXX11_OVERRIDE
        {
                // Don't do anything if they're not +Y
-               if (!memb->hasMode(np.GetModeChar()))
+               if (!memb->HasMode(&np))
                        return MOD_RES_PASSTHRU;
 
                // Let them do whatever they want to themselves.
@@ -150,14 +150,14 @@ class ModuleOjoin : public Module
                return MOD_RES_DENY;
        }
 
-       void Prioritize()
+       void Prioritize() CXX11_OVERRIDE
        {
                ServerInstance->Modules->SetPriority(this, I_OnUserPreJoin, PRIORITY_FIRST);
        }
 
        Version GetVersion() CXX11_OVERRIDE
        {
-               return Version("Network Business Join", VF_VENDOR);
+               return Version("Provides the OJOIN command, allows an oper to join a channel and be immune to kicks", VF_VENDOR);
        }
 };