]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_satopic.cpp
Convert WriteNumeric() calls to pass the parameters of the numeric as method parameters
[user/henk/code/inspircd.git] / src / modules / m_satopic.cpp
index c15c9e91bcb4e2e911e509c108f36b5d3240fc21..040d86b9a46b68cf1e9bf09b79d4d7043e7457c2 100644 (file)
@@ -17,8 +17,6 @@
  */
 
 
-/* $ModDesc: Provides a SATOPIC command */
-
 #include "inspircd.h"
 
 /** Handle /SATOPIC
@@ -40,17 +38,15 @@ class CommandSATopic : public Command
 
                if(target)
                {
-                       std::string newTopic = parameters[1];
-
-                       // 3rd parameter overrides access checks
-                       target->SetTopic(user, newTopic, true);
+                       const std::string& newTopic = parameters[1];
+                       target->SetTopic(user, newTopic);
                        ServerInstance->SNO->WriteGlobalSno('a', user->nick + " used SATOPIC on " + target->name + ", new topic: " + newTopic);
 
                        return CMD_SUCCESS;
                }
                else
                {
-                       user->WriteNumeric(401, "%s %s :No such nick/channel", user->nick.c_str(), parameters[0].c_str());
+                       user->WriteNumeric(Numerics::NoSuchNick(parameters[0]));
                        return CMD_FAILURE;
                }
        }
@@ -65,11 +61,6 @@ class ModuleSATopic : public Module
        {
        }
 
-       void init() CXX11_OVERRIDE
-       {
-               ServerInstance->Modules->AddService(cmd);
-       }
-
        Version GetVersion() CXX11_OVERRIDE
        {
                return Version("Provides a SATOPIC command", VF_VENDOR);