]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_showfile.cpp
Update copyright headers.
[user/henk/code/inspircd.git] / src / modules / m_showfile.cpp
index 99c54514007fcd615d1c39556e3e2d38b741d5a7..c88dcb50bada40d33116c3e5824c8818ad22ffa5 100644 (file)
@@ -1,7 +1,8 @@
 /*
  * InspIRCd -- Internet Relay Chat Daemon
  *
- *   Copyright (C) 2013 Attila Molnar <attilamolnar@hush.com>
+ *   Copyright (C) 2018 Sadie Powell <sadie@witchery.services>
+ *   Copyright (C) 2013-2014, 2016, 2018 Attila Molnar <attilamolnar@hush.com>
  *
  * This file is part of InspIRCd.  InspIRCd is free software: you can
  * redistribute it and/or modify it under the terms of the GNU General Public
@@ -55,13 +56,14 @@ class CommandShowFile : public Command
        {
                if (method == SF_NUMERIC)
                {
-                       if (!introtext.empty())
+                       if (!introtext.empty() && intronumeric)
                                user->WriteRemoteNumeric(intronumeric, introtext);
 
                        for (file_cache::const_iterator i = contents.begin(); i != contents.end(); ++i)
                                user->WriteRemoteNumeric(textnumeric, InspIRCd::Format("- %s", i->c_str()));
 
-                       user->WriteRemoteNumeric(endnumeric, endtext.c_str());
+                       if (!endtext.empty() && endnumeric)
+                               user->WriteRemoteNumeric(endnumeric, endtext.c_str());
                }
                else if (IS_LOCAL(user))
                {