-// opermotd module by typobox43
-
-using namespace std;
+/* +------------------------------------+
+ * | Inspire Internet Relay Chat Daemon |
+ * +------------------------------------+
+ *
+ * InspIRCd: (C) 2002-2007 InspIRCd Development Team
+ * See: http://www.inspircd.org/wiki/index.php/Credits
+ *
+ * This program is free but copyrighted software; see
+ * the file COPYING for details.
+ *
+ * ---------------------------------------------------
+ */
-#include <stdio.h>
+#include "inspircd.h"
#include "users.h"
#include "channels.h"
#include "modules.h"
-#include "inspircd.h"
-
/* $ModDesc: Shows a message to opers after oper-up, adds /opermotd */
static FileReader* opermotd;
user->WriteServ(std::string("425 ") + user->nick + std::string(" :OPERMOTD file is missing"));
return CMD_FAILURE;
}
+
user->WriteServ(std::string("375 ") + user->nick + std::string(" :- IRC Operators Message of the Day"));
+
for(int i=0; i != opermotd->FileSize(); i++)
{
user->WriteServ(std::string("372 ") + user->nick + std::string(" :- ") + opermotd->GetLine(i));
}
+
user->WriteServ(std::string("376 ") + user->nick + std::string(" :- End of OPERMOTD"));
- return CMD_SUCCESS;
+ /* don't route me */
+ return CMD_LOCALONLY;
}
/** Handle /OPERMOTD
}
ModuleOpermotd(InspIRCd* Me)
- : Module::Module(Me)
+ : Module(Me)
{
opermotd = NULL;
mycommand = new cmd_opermotd(ServerInstance);
ShowOperMOTD(user);
}
- virtual void OnRehash(const std::string ¶meter)
+ virtual void OnRehash(userrec* user, const std::string ¶meter)
{
LoadOperMOTD();
}
}
};
-extern "C" void* init_module(void)
+extern "C" DllExport void* init_module(void)
{
return new ModuleOpermotdFactory;
}