X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_sajoin.cpp;h=0748c013b96344c698f60f42203b9cf101cb32ee;hb=adb5ab48a2b6efd146b9cc85a62b45c6a70aa34d;hp=205cd656976c7e3ee331bd99331fe26113184c56;hpb=5c9427cde0a949a17a476311db0a2a275345337b;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_sajoin.cpp b/src/modules/m_sajoin.cpp index 205cd6569..0748c013b 100644 --- a/src/modules/m_sajoin.cpp +++ b/src/modules/m_sajoin.cpp @@ -21,8 +21,6 @@ #include "inspircd.h" -/* $ModDesc: Provides command SAJOIN to allow opers to force-join users to channels */ - /** Handle /SAJOIN */ class CommandSajoin : public Command @@ -32,7 +30,7 @@ class CommandSajoin : public Command { allow_empty_last_param = false; flags_needed = 'o'; Penalty = 0; syntax = " "; - TRANSLATE3(TR_NICK, TR_TEXT, TR_END); + TRANSLATE2(TR_NICK, TR_TEXT); } CmdResult Handle (const std::vector& parameters, User *user) @@ -40,9 +38,9 @@ class CommandSajoin : public Command User* dest = ServerInstance->FindNick(parameters[0]); if ((dest) && (dest->registered == REG_ALL)) { - if (ServerInstance->ULine(dest->server)) + if (dest->server->IsULine()) { - user->WriteNumeric(ERR_NOPRIVILEGES, "%s :Cannot use an SA command on a u-lined client",user->nick.c_str()); + user->WriteNumeric(ERR_NOPRIVILEGES, ":Cannot use an SA command on a u-lined client"); return CMD_FAILURE; } if (IS_LOCAL(user) && !ServerInstance->IsChannel(parameters[1])) @@ -60,18 +58,10 @@ class CommandSajoin : public Command if (localuser) { Channel* n = Channel::JoinUser(localuser, parameters[1], true); - if (n) + if (n && n->HasUser(dest)) { - if (n->HasUser(dest)) - { - ServerInstance->SNO->WriteToSnoMask('a', user->nick+" used SAJOIN to make "+dest->nick+" join "+parameters[1]); - return CMD_SUCCESS; - } - else - { - user->WriteNotice("*** Could not join "+dest->nick+" to "+parameters[1]+" (User is probably banned, or blocking modes)"); - return CMD_FAILURE; - } + ServerInstance->SNO->WriteGlobalSno('a', user->nick+" used SAJOIN to make "+dest->nick+" join "+parameters[1]); + return CMD_SUCCESS; } else { @@ -81,7 +71,6 @@ class CommandSajoin : public Command } else { - ServerInstance->SNO->WriteToSnoMask('a', user->nick+" sent remote SAJOIN to make "+dest->nick+" join "+parameters[1]); return CMD_SUCCESS; } } @@ -110,11 +99,6 @@ class ModuleSajoin : public Module { } - void init() CXX11_OVERRIDE - { - ServerInstance->Modules->AddService(cmd); - } - Version GetVersion() CXX11_OVERRIDE { return Version("Provides command SAJOIN to allow opers to force-join users to channels", VF_OPTCOMMON | VF_VENDOR);