summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2005-11-30 07:57:38 +0000
committerw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2005-11-30 07:57:38 +0000
commit9dd49a391f0602586b85cc0b6dc54fc0d50a67d2 (patch)
tree19a4615e9abe810136b2b2b06a93b9013bb7a25d /src
parent7456e47914b588f207a98c17a25fcdd2a8f4d176 (diff)
Stylistic changes.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2026 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r--src/modules/m_opermotd.cpp76
1 files 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;
-
}