summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Powell <petpow@saberuk.com>2019-04-19 12:39:37 +0100
committerPeter Powell <petpow@saberuk.com>2019-04-19 12:40:28 +0100
commit8b0d03971797110112acadf683e08301b094ca92 (patch)
tree1dea402bd77bcbf7bc1cdaa18ed5ae05632dbbbb
parent0f2341e76eb54fb38b97305609db9f025331d002 (diff)
Demote core_ison and core_userhost to commands in core_user.
These are not important enough for their own module.
-rw-r--r--src/coremods/core_user/cmd_ison.cpp (renamed from src/coremods/core_ison.cpp)40
-rw-r--r--src/coremods/core_user/cmd_userhost.cpp (renamed from src/coremods/core_userhost.cpp)43
-rw-r--r--src/coremods/core_user/core_user.cpp4
-rw-r--r--src/coremods/core_user/core_user.h46
4 files changed, 52 insertions, 81 deletions
diff --git a/src/coremods/core_ison.cpp b/src/coremods/core_user/cmd_ison.cpp
index ec097f1c6..a316b3c83 100644
--- a/src/coremods/core_ison.cpp
+++ b/src/coremods/core_user/cmd_ison.cpp
@@ -19,26 +19,7 @@
#include "inspircd.h"
-
-/** Handle /ISON.
- */
-class CommandIson : public SplitCommand
-{
- public:
- /** Constructor for ison.
- */
- CommandIson(Module* parent)
- : SplitCommand(parent, "ISON", 1)
- {
- syntax = "<nick> [<nick>]+";
- }
- /** Handle command.
- * @param parameters The parameters to the command
- * @param user The user issuing the command
- * @return A value from CmdResult to indicate command success or failure.
- */
- CmdResult HandleLocal(LocalUser* user, const Params& parameters) CXX11_OVERRIDE;
-};
+#include "core_user.h"
class IsonReplyBuilder : public Numeric::Builder<' ', true>
{
@@ -76,22 +57,3 @@ CmdResult CommandIson::HandleLocal(LocalUser* user, const Params& parameters)
reply.Flush();
return CMD_SUCCESS;
}
-
-class CoreModIson : public Module
-{
- private:
- CommandIson cmd;
-
- public:
- CoreModIson()
- : cmd(this)
- {
- }
-
- Version GetVersion() CXX11_OVERRIDE
- {
- return Version("Provides the ISON command", VF_CORE | VF_VENDOR);
- }
-};
-
-MODULE_INIT(CoreModIson)
diff --git a/src/coremods/core_userhost.cpp b/src/coremods/core_user/cmd_userhost.cpp
index e21e7d95b..f531d2395 100644
--- a/src/coremods/core_userhost.cpp
+++ b/src/coremods/core_user/cmd_userhost.cpp
@@ -19,29 +19,7 @@
#include "inspircd.h"
-
-/** Handle /USERHOST.
- */
-class CommandUserhost : public Command
-{
- UserModeReference hideopermode;
-
- public:
- /** Constructor for userhost.
- */
- CommandUserhost(Module* parent)
- : Command(parent,"USERHOST", 1)
- , hideopermode(parent, "hideoper")
- {
- syntax = "<nick> [<nick>]+";
- }
- /** Handle command.
- * @param parameters The parameters to the command
- * @param user The user issuing the command
- * @return A value from CmdResult to indicate command success or failure.
- */
- CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE;
-};
+#include "core_user.h"
CmdResult CommandUserhost::Handle(User* user, const Params& parameters)
{
@@ -81,22 +59,3 @@ CmdResult CommandUserhost::Handle(User* user, const Params& parameters)
return CMD_SUCCESS;
}
-
-class CoreModUserhost : public Module
-{
- private:
- CommandUserhost cmd;
-
- public:
- CoreModUserhost()
- : cmd(this)
- {
- }
-
- Version GetVersion() CXX11_OVERRIDE
- {
- return Version("Provides the USERHOST command", VF_CORE | VF_VENDOR);
- }
-};
-
-MODULE_INIT(CoreModUserhost)
diff --git a/src/coremods/core_user/core_user.cpp b/src/coremods/core_user/core_user.cpp
index 66622d34d..f2816180b 100644
--- a/src/coremods/core_user/core_user.cpp
+++ b/src/coremods/core_user/core_user.cpp
@@ -147,6 +147,8 @@ class CoreModUser : public Module
CommandPong cmdpong;
CommandQuit cmdquit;
CommandUser cmduser;
+ CommandIson cmdison;
+ CommandUserhost cmduserhost;
SimpleUserModeHandler invisiblemode;
ModeUserOperator operatormode;
ModeUserServerNoticeMask snomaskmode;
@@ -161,6 +163,8 @@ class CoreModUser : public Module
, cmdpong(this)
, cmdquit(this)
, cmduser(this)
+ , cmdison(this)
+ , cmduserhost(this)
, invisiblemode(this, "invisible", 'i')
, operatormode(this)
, snomaskmode(this)
diff --git a/src/coremods/core_user/core_user.h b/src/coremods/core_user/core_user.h
index ea28176d4..b4f04cd9d 100644
--- a/src/coremods/core_user/core_user.h
+++ b/src/coremods/core_user/core_user.h
@@ -70,6 +70,28 @@ class CommandAway : public Command
RouteDescriptor GetRouting(User* user, const Params& parameters) CXX11_OVERRIDE;
};
+/** Handle /ISON.
+ */
+class CommandIson : public SplitCommand
+{
+ public:
+ /** Constructor for ison.
+ */
+ CommandIson(Module* parent)
+ : SplitCommand(parent, "ISON", 1)
+ {
+ allow_empty_last_param = false;
+ syntax = "<nick> [<nick>]+";
+ }
+ /** Handle command.
+ * @param parameters The parameters to the command
+ * @param user The user issuing the command
+ * @return A value from CmdResult to indicate command success or failure.
+ */
+ CmdResult HandleLocal(LocalUser* user, const Params& parameters) CXX11_OVERRIDE;
+};
+
+
/** Handle /NICK.
*/
class CommandNick : public SplitCommand
@@ -157,6 +179,30 @@ class CommandUser : public SplitCommand
static CmdResult CheckRegister(LocalUser* user);
};
+/** Handle /USERHOST.
+ */
+class CommandUserhost : public Command
+{
+ UserModeReference hideopermode;
+
+ public:
+ /** Constructor for userhost.
+ */
+ CommandUserhost(Module* parent)
+ : Command(parent,"USERHOST", 1)
+ , hideopermode(parent, "hideoper")
+ {
+ allow_empty_last_param = false;
+ syntax = "<nick> [<nick>]+";
+ }
+ /** Handle command.
+ * @param parameters The parameters to the command
+ * @param user The user issuing the command
+ * @return A value from CmdResult to indicate command success or failure.
+ */
+ CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE;
+};
+
/** User mode +s
*/
class ModeUserServerNoticeMask : public ModeHandler