]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_sajoin.cpp
Fix m_randquote with 0 quotes
[user/henk/code/inspircd.git] / src / modules / m_sajoin.cpp
index 2153786f6b928f68a32ec72b7bf5b496b30f4ed4..932b564fa5e27e31c1ff9b609637b38a6ed10c1b 100644 (file)
@@ -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 = "<nick> <channel>";
                TRANSLATE3(TR_NICK, TR_TEXT, TR_END);
        }
@@ -37,7 +38,7 @@ class CommandSajoin : public Command
        CmdResult Handle (const std::vector<std::string>& parameters, User *user)
        {
                User* dest = ServerInstance->FindNick(parameters[0]);
-               if (dest)
+               if ((dest) && (dest->registered == REG_ALL))
                {
                        if (ServerInstance->ULine(dest->server))
                        {
@@ -112,7 +113,7 @@ class ModuleSajoin : public Module
 
        void init()
        {
-               ServerInstance->AddCommand(&cmd);
+               ServerInstance->Modules->AddService(cmd);
        }
 
        virtual ~ModuleSajoin()