]> 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 bf65cc5d5e9ab2a1e61b0c1380b19e3e091d1ee8..040d86b9a46b68cf1e9bf09b79d4d7043e7457c2 100644 (file)
@@ -17,8 +17,6 @@
  */
 
 
-/* $ModDesc: Provides a SATOPIC command */
-
 #include "inspircd.h"
 
 /** Handle /SATOPIC
@@ -40,18 +38,15 @@ class CommandSATopic : public Command
 
                if(target)
                {
-                       std::string newTopic = parameters[1];
-
-                       // 3rd parameter overrides access checks
-                       target->SetTopic(user, newTopic, true);
-                       ServerInstance->SNO->WriteToSnoMask('a', user->nick + " used SATOPIC on " + target->name + ", new topic: " + newTopic);
-                       ServerInstance->PI->SendSNONotice("A", user->nick + " used SATOPIC on " + target->name + ", new topic: " + newTopic);
+                       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;
                }
        }
@@ -63,15 +58,10 @@ class ModuleSATopic : public Module
  public:
        ModuleSATopic()
        : cmd(this)
-       {
-               ServerInstance->AddCommand(&cmd);
-       }
-
-       virtual ~ModuleSATopic()
        {
        }
 
-       virtual Version GetVersion()
+       Version GetVersion() CXX11_OVERRIDE
        {
                return Version("Provides a SATOPIC command", VF_VENDOR);
        }