]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
m_showfile Replace User::SendText() call with WriteCommand()
authorAttila Molnar <attilamolnar@hush.com>
Wed, 30 Mar 2016 10:34:41 +0000 (12:34 +0200)
committerAttila Molnar <attilamolnar@hush.com>
Wed, 30 Mar 2016 10:34:41 +0000 (12:34 +0200)
src/modules/m_showfile.cpp

index 9973bf2b6615819f34df647b1a3caae73c8034b4..57c501e909c7e5704eda3ccdbde37d496cb45b33 100644 (file)
@@ -44,7 +44,6 @@ class CommandShowFile : public Command
 
        CmdResult Handle(const std::vector<std::string>& parameters, User* user) CXX11_OVERRIDE
        {
-               const std::string& sn = ServerInstance->Config->ServerName;
                if (method == SF_NUMERIC)
                {
                        if (!introtext.empty())
@@ -58,9 +57,11 @@ class CommandShowFile : public Command
                else
                {
                        const char* msgcmd = (method == SF_MSG ? "PRIVMSG" : "NOTICE");
-                       std::string header = InspIRCd::Format(":%s %s %s :", sn.c_str(), msgcmd, user->nick.c_str());
                        for (file_cache::const_iterator i = contents.begin(); i != contents.end(); ++i)
-                               user->SendText(header + *i);
+                       {
+                               const std::string& line = *i;
+                               user->WriteCommand(msgcmd, ":" + line);
+                       }
                }
                return CMD_SUCCESS;
        }