summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorpeavey <peavey@e03df62e-2008-0410-955e-edbf42e46eb7>2009-10-13 14:16:16 +0000
committerpeavey <peavey@e03df62e-2008-0410-955e-edbf42e46eb7>2009-10-13 14:16:16 +0000
commit2d043de488ea65807b51b35a4436bbbf570ca29c (patch)
treef07129f223918ecfbc38ec331b99b551a12a6ce6 /src/modules
parentd1ddbd62f91d4b9453447b5d25f5e41e807b0010 (diff)
removes unnecessary checks in modules, removes a superfluous else statement, fixes some formatting. Patch by dKingston.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11867 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/m_chghost.cpp10
-rw-r--r--src/modules/m_chgident.cpp9
-rw-r--r--src/modules/m_chgname.cpp9
-rw-r--r--src/modules/m_gecosban.cpp6
-rw-r--r--src/modules/m_maphide.cpp6
-rw-r--r--src/modules/m_nopartmsg.cpp3
6 files changed, 14 insertions, 29 deletions
diff --git a/src/modules/m_chghost.cpp b/src/modules/m_chghost.cpp
index fdec5d6d0..7901fad7f 100644
--- a/src/modules/m_chghost.cpp
+++ b/src/modules/m_chghost.cpp
@@ -24,13 +24,14 @@ class CommandChghost : public Command
public:
CommandChghost(Module* Creator, char* hmap) : Command(Creator,"CHGHOST", 2), hostmap(hmap)
{
- flags_needed = 'o'; syntax = "<nick> <newhost>";
+ flags_needed = 'o';
+ syntax = "<nick> <newhost>";
TRANSLATE3(TR_NICK, TR_TEXT, TR_END);
}
CmdResult Handle(const std::vector<std::string> &parameters, User *user)
{
- const char * x = parameters[1].c_str();
+ const char* x = parameters[1].c_str();
for (; *x; x++)
{
@@ -40,11 +41,6 @@ class CommandChghost : public Command
return CMD_FAILURE;
}
}
- if (parameters[1].empty())
- {
- user->WriteServ("NOTICE %s :*** CHGHOST: Host must be specified", user->nick.c_str());
- return CMD_FAILURE;
- }
if ((parameters[1].c_str() - x) > 63)
{
diff --git a/src/modules/m_chgident.cpp b/src/modules/m_chgident.cpp
index 135b26446..f352c1c2b 100644
--- a/src/modules/m_chgident.cpp
+++ b/src/modules/m_chgident.cpp
@@ -22,7 +22,8 @@ class CommandChgident : public Command
public:
CommandChgident(Module* Creator) : Command(Creator,"CHGIDENT", 2)
{
- flags_needed = 'o'; syntax = "<nick> <newident>";
+ flags_needed = 'o';
+ syntax = "<nick> <newident>";
TRANSLATE3(TR_NICK, TR_TEXT, TR_END);
}
@@ -36,12 +37,6 @@ class CommandChgident : public Command
return CMD_FAILURE;
}
- if (parameters[1].empty())
- {
- user->WriteServ("NOTICE %s :*** CHGIDENT: Ident must be specified", user->nick.c_str());
- return CMD_FAILURE;
- }
-
if (parameters[1].length() > ServerInstance->Config->Limits.IdentMax)
{
user->WriteServ("NOTICE %s :*** CHGIDENT: Ident is too long", user->nick.c_str());
diff --git a/src/modules/m_chgname.cpp b/src/modules/m_chgname.cpp
index 17ad9dc48..0fac2bdad 100644
--- a/src/modules/m_chgname.cpp
+++ b/src/modules/m_chgname.cpp
@@ -22,7 +22,8 @@ class CommandChgname : public Command
public:
CommandChgname(Module* Creator) : Command(Creator,"CHGNAME", 2, 2)
{
- flags_needed = 'o'; syntax = "<nick> <newname>";
+ flags_needed = 'o';
+ syntax = "<nick> <newname>";
TRANSLATE3(TR_NICK, TR_TEXT, TR_END);
}
@@ -36,12 +37,6 @@ class CommandChgname : public Command
return CMD_FAILURE;
}
- if (parameters[1].empty())
- {
- user->WriteServ("NOTICE %s :*** GECOS must be specified", user->nick.c_str());
- return CMD_FAILURE;
- }
-
if (parameters[1].length() > ServerInstance->Config->Limits.MaxGecos)
{
user->WriteServ("NOTICE %s :*** GECOS too long", user->nick.c_str());
diff --git a/src/modules/m_gecosban.cpp b/src/modules/m_gecosban.cpp
index 9d1550b38..42830c660 100644
--- a/src/modules/m_gecosban.cpp
+++ b/src/modules/m_gecosban.cpp
@@ -17,9 +17,9 @@
class ModuleGecosBan : public Module
{
- private:
public:
- ModuleGecosBan() {
+ ModuleGecosBan()
+ {
Implementation eventlist[] = { I_OnCheckBan, I_On005Numeric };
ServerInstance->Modules->Attach(eventlist, this, 2);
}
@@ -49,6 +49,4 @@ class ModuleGecosBan : public Module
}
};
-
MODULE_INIT(ModuleGecosBan)
-
diff --git a/src/modules/m_maphide.cpp b/src/modules/m_maphide.cpp
index 4c9d0591f..d05200164 100644
--- a/src/modules/m_maphide.cpp
+++ b/src/modules/m_maphide.cpp
@@ -20,9 +20,9 @@ class ModuleMapHide : public Module
std::string url;
public:
ModuleMapHide()
- {
- ServerInstance->Modules->Attach(I_OnPreCommand, this);
- ServerInstance->Modules->Attach(I_OnRehash, this);
+ {
+ Implementation eventlist[] = { I_OnPreCommand, I_OnRehash };
+ ServerInstance->Modules->Attach(eventlist, this, 2);
OnRehash(NULL);
}
diff --git a/src/modules/m_nopartmsg.cpp b/src/modules/m_nopartmsg.cpp
index 270159147..cdd65417f 100644
--- a/src/modules/m_nopartmsg.cpp
+++ b/src/modules/m_nopartmsg.cpp
@@ -19,7 +19,8 @@ class ModulePartMsgBan : public Module
{
private:
public:
- ModulePartMsgBan() {
+ ModulePartMsgBan()
+ {
Implementation eventlist[] = { I_OnUserPart, I_On005Numeric };
ServerInstance->Modules->Attach(eventlist, this, 2);
}