X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_ojoin.cpp;h=67b79e07c4965f62c1fa34d48e56b1a37bb40cf2;hb=d4a1ea70451abb333e71f9cff09b624db59531a0;hp=88b63bef25f405d0f25c3d2360566a04a961eb26;hpb=da29af8cba49d51e53d6e68237ccbf6370b6dd1f;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_ojoin.cpp b/src/modules/m_ojoin.cpp index 88b63bef2..67b79e07c 100644 --- a/src/modules/m_ojoin.cpp +++ b/src/modules/m_ojoin.cpp @@ -34,11 +34,11 @@ class CommandOjoin : public SplitCommand : SplitCommand(parent, "OJOIN", 1) , npmh(&mode) { - flags_needed = 'o'; Penalty = 0; syntax = ""; + flags_needed = 'o'; syntax = ""; active = false; } - CmdResult HandleLocal(const std::vector& parameters, LocalUser* user) + CmdResult HandleLocal(LocalUser* user, const Params& parameters) CXX11_OVERRIDE { // Make sure the channel name is allowable. if (!ServerInstance->IsChannel(parameters[0])) @@ -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 @@ -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 ¶meter, bool adding) + ModResult AccessCheck(User* source, Channel* channel, std::string ¶meter, 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,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); }