From 9dd49a391f0602586b85cc0b6dc54fc0d50a67d2 Mon Sep 17 00:00:00 2001 From: w00t Date: Wed, 30 Nov 2005 07:57:38 +0000 Subject: Stylistic changes. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2026 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_opermotd.cpp | 76 +++++++++++++++++++--------------------------- 1 file changed, 32 insertions(+), 44 deletions(-) diff --git a/src/modules/m_opermotd.cpp b/src/modules/m_opermotd.cpp index 3d79ab13e..67c066641 100644 --- a/src/modules/m_opermotd.cpp +++ b/src/modules/m_opermotd.cpp @@ -15,7 +15,8 @@ Server* Srv; void do_opermotd(char** parameters, int pcnt, userrec* user); -void LoadOperMOTD() { +void LoadOperMOTD() +{ ConfigReader* conf = new ConfigReader; std::string filename; @@ -26,96 +27,83 @@ void LoadOperMOTD() { } -void ShowOperMOTD(userrec* user) { - - if(!opermotd->FileSize()) { - +void ShowOperMOTD(userrec* user) +{ + if(!opermotd->FileSize()) + { Srv->SendServ(user->fd,std::string("425 ") + user->nick + std::string(" :OPERMOTD file is missing")); return; - } Srv->SendServ(user->fd,std::string("375 ") + user->nick + std::string(" :- IRC Operators Message of the Day")); - for(int i=0; i != opermotd->FileSize(); i++) { - + for(int i=0; i != opermotd->FileSize(); i++) + { Srv->SendServ(user->fd,std::string("372 ") + user->nick + std::string(" :- ") + opermotd->GetLine(i)); - } Srv->SendServ(user->fd,std::string("376 ") + user->nick + std::string(" :- End of OPERMOTD")); } -void do_opermotd(char** parameters, int pcnt, userrec* user) { - +void do_opermotd(char** parameters, int pcnt, userrec* user) +{ ShowOperMOTD(user); - } -class ModuleOpermotd : public Module { - +class ModuleOpermotd : public Module +{ public: - - ModuleOpermotd() { - + ModuleOpermotd() + { Srv = new Server; Srv->AddCommand("OPERMOTD",do_opermotd,'o',0,"m_opermotd.so"); - opermotd = new FileReader(); LoadOperMOTD(); - } - virtual ~ModuleOpermotd() { - + virtual ~ModuleOpermotd() + { delete Srv; - } - virtual Version GetVersion() { - + virtual Version GetVersion() + { return Version(1,0,0,1,VF_VENDOR); - } - virtual void OnOper(userrec* user, std::string opertype) { - + virtual void OnOper(userrec* user, std::string opertype) + { ShowOperMOTD(user); - } - virtual void OnRehash() { - + virtual void OnRehash() + { LoadOperMOTD(); - } }; -class ModuleOpermotdFactory : public ModuleFactory { - +class ModuleOpermotdFactory : public ModuleFactory +{ public: - - ModuleOpermotdFactory() { - + ModuleOpermotdFactory() + { } - ~ModuleOpermotdFactory() { - + ~ModuleOpermotdFactory() + { } - virtual Module* CreateModule() { - + virtual Module* CreateModule() + { return new ModuleOpermotd; - } }; -extern "C" void* init_module(void) { - +extern "C" void* init_module(void) +{ return new ModuleOpermotdFactory; - } -- cgit v1.2.3