summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2016-08-19 11:21:19 +0200
committerAttila Molnar <attilamolnar@hush.com>2016-08-19 11:21:19 +0200
commitda04e0622c37d3d1ec6c3313fb5a82cbf9901329 (patch)
tree63df2e234747c853d535f488637ff3f387c47c5f /src/modules
parent1e09b2cb1e2a5989163fff02cad5498ad151bd00 (diff)
m_spanningtree Put command handlers with class names that collide with core commands into the SpanningTree namespace
This fixes issues in static builds
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/m_spanningtree/away.cpp2
-rw-r--r--src/modules/m_spanningtree/commands.h47
-rw-r--r--src/modules/m_spanningtree/nick.cpp2
3 files changed, 33 insertions, 18 deletions
diff --git a/src/modules/m_spanningtree/away.cpp b/src/modules/m_spanningtree/away.cpp
index f14c8ac98..7c514c49e 100644
--- a/src/modules/m_spanningtree/away.cpp
+++ b/src/modules/m_spanningtree/away.cpp
@@ -23,7 +23,7 @@
#include "utils.h"
#include "commands.h"
-CmdResult CommandAway::HandleRemote(RemoteUser* u, std::vector<std::string>& params)
+CmdResult CommandAway::HandleRemote(::RemoteUser* u, std::vector<std::string>& params)
{
if (params.size())
{
diff --git a/src/modules/m_spanningtree/commands.h b/src/modules/m_spanningtree/commands.h
index feecc7dd2..8eea02915 100644
--- a/src/modules/m_spanningtree/commands.h
+++ b/src/modules/m_spanningtree/commands.h
@@ -23,6 +23,21 @@
#include "commandbuilder.h"
#include "remoteuser.h"
+namespace SpanningTree
+{
+ class CommandAway;
+ class CommandNick;
+ class CommandPing;
+ class CommandPong;
+ class CommandServer;
+}
+
+using SpanningTree::CommandAway;
+using SpanningTree::CommandNick;
+using SpanningTree::CommandPing;
+using SpanningTree::CommandPong;
+using SpanningTree::CommandServer;
+
/** Handle /RCONNECT
*/
class CommandRConnect : public Command
@@ -224,11 +239,11 @@ class CommandResync : public ServerOnlyServerCommand<CommandResync>
RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters) { return ROUTE_LOCALONLY; }
};
-class CommandAway : public UserOnlyServerCommand<CommandAway>
+class SpanningTree::CommandAway : public UserOnlyServerCommand<SpanningTree::CommandAway>
{
public:
- CommandAway(Module* Creator) : UserOnlyServerCommand<CommandAway>(Creator, "AWAY", 0, 2) { }
- CmdResult HandleRemote(RemoteUser* user, std::vector<std::string>& parameters);
+ CommandAway(Module* Creator) : UserOnlyServerCommand<SpanningTree::CommandAway>(Creator, "AWAY", 0, 2) { }
+ CmdResult HandleRemote(::RemoteUser* user, std::vector<std::string>& parameters);
class Builder : public CmdBuilder
{
@@ -275,14 +290,14 @@ class CommandIdle : public UserOnlyServerCommand<CommandIdle>
RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters) { return ROUTE_UNICAST(parameters[0]); }
};
-class CommandNick : public UserOnlyServerCommand<CommandNick>
+class SpanningTree::CommandNick : public UserOnlyServerCommand<SpanningTree::CommandNick>
{
public:
- CommandNick(Module* Creator) : UserOnlyServerCommand<CommandNick>(Creator, "NICK", 2) { }
- CmdResult HandleRemote(RemoteUser* user, std::vector<std::string>& parameters);
+ CommandNick(Module* Creator) : UserOnlyServerCommand<SpanningTree::CommandNick>(Creator, "NICK", 2) { }
+ CmdResult HandleRemote(::RemoteUser* user, std::vector<std::string>& parameters);
};
-class CommandPing : public ServerCommand
+class SpanningTree::CommandPing : public ServerCommand
{
public:
CommandPing(Module* Creator) : ServerCommand(Creator, "PING", 1) { }
@@ -290,10 +305,10 @@ class CommandPing : public ServerCommand
RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters) { return ROUTE_UNICAST(parameters[0]); }
};
-class CommandPong : public ServerOnlyServerCommand<CommandPong>
+class SpanningTree::CommandPong : public ServerOnlyServerCommand<SpanningTree::CommandPong>
{
public:
- CommandPong(Module* Creator) : ServerOnlyServerCommand<CommandPong>(Creator, "PONG", 1) { }
+ CommandPong(Module* Creator) : ServerOnlyServerCommand<SpanningTree::CommandPong>(Creator, "PONG", 1) { }
CmdResult HandleServer(TreeServer* server, std::vector<std::string>& parameters);
RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters) { return ROUTE_UNICAST(parameters[0]); }
};
@@ -309,12 +324,12 @@ class CommandSave : public ServerCommand
CmdResult Handle(User* user, std::vector<std::string>& parameters);
};
-class CommandServer : public ServerOnlyServerCommand<CommandServer>
+class SpanningTree::CommandServer : public ServerOnlyServerCommand<SpanningTree::CommandServer>
{
static void HandleExtra(TreeServer* newserver, const std::vector<std::string>& params);
public:
- CommandServer(Module* Creator) : ServerOnlyServerCommand<CommandServer>(Creator, "SERVER", 3) { }
+ CommandServer(Module* Creator) : ServerOnlyServerCommand<SpanningTree::CommandServer>(Creator, "SERVER", 3) { }
CmdResult HandleServer(TreeServer* server, std::vector<std::string>& parameters);
class Builder : public CmdBuilder
@@ -393,16 +408,16 @@ class SpanningTreeCommands
CommandFHost fhost;
CommandFIdent fident;
CommandFName fname;
- CommandAway away;
+ SpanningTree::CommandAway away;
CommandAddLine addline;
CommandDelLine delline;
CommandEncap encap;
CommandIdle idle;
- CommandNick nick;
- CommandPing ping;
- CommandPong pong;
+ SpanningTree::CommandNick nick;
+ SpanningTree::CommandPing ping;
+ SpanningTree::CommandPong pong;
CommandSave save;
- CommandServer server;
+ SpanningTree::CommandServer server;
CommandSQuit squit;
CommandSNONotice snonotice;
CommandEndBurst endburst;
diff --git a/src/modules/m_spanningtree/nick.cpp b/src/modules/m_spanningtree/nick.cpp
index 1d853a2df..9e290e07f 100644
--- a/src/modules/m_spanningtree/nick.cpp
+++ b/src/modules/m_spanningtree/nick.cpp
@@ -30,7 +30,7 @@
#include "commands.h"
#include "treeserver.h"
-CmdResult CommandNick::HandleRemote(RemoteUser* user, std::vector<std::string>& params)
+CmdResult CommandNick::HandleRemote(::RemoteUser* user, std::vector<std::string>& params)
{
if ((isdigit(params[0][0])) && (params[0] != user->uuid))
throw ProtocolException("Attempted to change nick to an invalid or non-matching UUID");