]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_sajoin.cpp
m_delayjoin Only send JOIN on mode change if the mode being changed is a prefix mode
[user/henk/code/inspircd.git] / src / modules / m_sajoin.cpp
index df88cd8f7cbccc519dd6a065591217614b81d1c7..7ac46573224f8eb9aa1e6f9edd7bc08e4060b6f5 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))
                        {
@@ -64,7 +65,7 @@ class CommandSajoin : public Command
                                {
                                        if (n->HasUser(dest))
                                        {
-                                               ServerInstance->SNO->WriteToSnoMask('a', user->nick+" used SAJOIN to make "+dest->nick+" join "+parameters[1]);
+                                               ServerInstance->SNO->WriteGlobalSno('a', user->nick+" used SAJOIN to make "+dest->nick+" join "+parameters[1]);
                                                return CMD_SUCCESS;
                                        }
                                        else
@@ -81,7 +82,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;
                        }
                }
@@ -108,7 +108,11 @@ class ModuleSajoin : public Module
        ModuleSajoin()
                : cmd(this)
        {
-               ServerInstance->AddCommand(&cmd);
+       }
+
+       void init()
+       {
+               ServerInstance->Modules->AddService(cmd);
        }
 
        virtual ~ModuleSajoin()