]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_ojoin.cpp
Implement support for configurable casemapping & default to ASCII.
[user/henk/code/inspircd.git] / src / modules / m_ojoin.cpp
index 88b63bef25f405d0f25c3d2360566a04a961eb26..76e66bdc23cbff3d54b128d6253558cce20f42fc 100644 (file)
@@ -34,7 +34,7 @@ class CommandOjoin : public SplitCommand
                : SplitCommand(parent, "OJOIN", 1)
                , npmh(&mode)
        {
-               flags_needed = 'o'; Penalty = 0; syntax = "<channel>";
+               flags_needed = 'o'; syntax = "<channel>";
                active = false;
        }
 
@@ -58,9 +58,9 @@ class CommandOjoin : public SplitCommand
 
                        if (notice)
                        {
-                               channel->WriteChannelWithServ(ServerInstance->Config->ServerName, "NOTICE %s :%s joined on official network business.",
-                                       parameters[0].c_str(), user->nick.c_str());
-                               ServerInstance->PI->SendChannelNotice(channel, 0, user->nick + " joined on official network business.");
+                               const std::string msg = user->nick + " joined on official network business.";
+                               channel->WriteNotice(msg);
+                               ServerInstance->PI->SendChannelNotice(channel, 0, msg);
                        }
                }
                else
@@ -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,7 +150,7 @@ class ModuleOjoin : public Module
                return MOD_RES_DENY;
        }
 
-       void Prioritize()
+       void Prioritize() CXX11_OVERRIDE
        {
                ServerInstance->Modules->SetPriority(this, I_OnUserPreJoin, PRIORITY_FIRST);
        }