X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_sajoin.cpp;h=2d6bb0f97e5ad9b787b00949abaf32185a28cdd9;hb=551d687ec6d7ce44be35fae0dd7345fe73c4f63a;hp=df88cd8f7cbccc519dd6a065591217614b81d1c7;hpb=c8b41aa5d256d99eee67ec94492a94dc30e0ea35;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_sajoin.cpp b/src/modules/m_sajoin.cpp index df88cd8f7..2d6bb0f97 100644 --- a/src/modules/m_sajoin.cpp +++ b/src/modules/m_sajoin.cpp @@ -30,6 +30,7 @@ class CommandSajoin : public Command public: CommandSajoin(Module* Creator) : Command(Creator,"SAJOIN", 2) { + allow_empty_last_param = false; flags_needed = 'o'; Penalty = 0; syntax = " "; TRANSLATE3(TR_NICK, TR_TEXT, TR_END); } @@ -37,7 +38,7 @@ class CommandSajoin : public Command CmdResult Handle (const std::vector& parameters, User *user) { User* dest = ServerInstance->FindNick(parameters[0]); - if (dest) + if ((dest) && (dest->registered == REG_ALL)) { if (ServerInstance->ULine(dest->server)) { @@ -57,7 +58,7 @@ class CommandSajoin : public Command */ if (IS_LOCAL(dest)) { - Channel::JoinUser(dest, parameters[1].c_str(), true, "", false, ServerInstance->Time()); + Channel::JoinUser(dest, parameters[1], true, "", false, ServerInstance->Time()); /* Fix for dotslasher and w00t - if the join didnt succeed, return CMD_FAILURE so that it doesnt propagate */ Channel* n = ServerInstance->FindChan(parameters[1]); if (n) @@ -108,18 +109,17 @@ class ModuleSajoin : public Module ModuleSajoin() : cmd(this) { - ServerInstance->AddCommand(&cmd); } - virtual ~ModuleSajoin() + void init() { + ServerInstance->Modules->AddService(cmd); } virtual Version GetVersion() { return Version("Provides command SAJOIN to allow opers to force-join users to channels", VF_OPTCOMMON | VF_VENDOR); } - }; MODULE_INIT(ModuleSajoin)