]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_opermotd.cpp
m_spanningtree Remove SpanningTreeUtilities* fields and parameters
[user/henk/code/inspircd.git] / src / modules / m_opermotd.cpp
index b228dc8b771fb8795299e2ed45baed2d1fa238a0..1be81e641823e6a5f8e9079b8df34cd2f13590e1 100644 (file)
@@ -22,8 +22,6 @@
 
 #include "inspircd.h"
 
-/* $ModDesc: Shows a message to opers after oper-up, adds /opermotd */
-
 /** Handle /OPERMOTD
  */
 class CommandOpermotd : public Command
@@ -86,8 +84,6 @@ class ModuleOpermotd : public Module
        {
                ServerInstance->Modules->AddService(cmd);
                OnRehash(NULL);
-               Implementation eventlist[] = { I_OnRehash, I_OnOper };
-               ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation));
        }
 
        Version GetVersion() CXX11_OVERRIDE
@@ -107,9 +103,15 @@ class ModuleOpermotd : public Module
                ConfigTag* conf = ServerInstance->Config->ConfValue("opermotd");
                onoper = conf->getBool("onoper", true);
 
-               FileReader f(conf->getString("file", "opermotd"));
-               for (int i=0, filesize = f.FileSize(); i < filesize; i++)
-                       cmd.opermotd.push_back(f.GetLine(i));
+               try
+               {
+                       FileReader reader(conf->getString("file", "opermotd"));
+                       cmd.opermotd = reader.GetVector();
+               }
+               catch (CoreException&)
+               {
+                       // Nothing happens here as we do the error handling in ShowOperMOTD.
+               }
 
                if (conf->getBool("processcolors"))
                        InspIRCd::ProcessColors(cmd.opermotd);