summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/commands/cmd_server.h2
-rw-r--r--src/commands/cmd_server.cpp9
2 files changed, 9 insertions, 2 deletions
diff --git a/include/commands/cmd_server.h b/include/commands/cmd_server.h
index 9de4b8381..f562a7ddf 100644
--- a/include/commands/cmd_server.h
+++ b/include/commands/cmd_server.h
@@ -29,7 +29,7 @@ class CommandServer : public Command
public:
/** Constructor for server.
*/
- CommandServer (InspIRCd* Instance) : Command(Instance,"SERVER",0,0) { }
+ CommandServer (InspIRCd* Instance) : Command(Instance,"SERVER",0,0,true) { }
/** Handle command.
* @param parameters The parameters to the comamnd
* @param pcnt The number of parameters passed to teh command
diff --git a/src/commands/cmd_server.cpp b/src/commands/cmd_server.cpp
index 81f9e722c..811d59057 100644
--- a/src/commands/cmd_server.cpp
+++ b/src/commands/cmd_server.cpp
@@ -23,6 +23,13 @@ extern "C" DllExport Command* init_command(InspIRCd* Instance)
CmdResult CommandServer::Handle (const std::vector<std::string>&, User *user)
{
- user->WriteNumeric(ERR_ALREADYREGISTERED, "%s :You are already registered. (Perhaps your IRC client does not have a /SERVER command).",user->nick.c_str());
+ if (user->registered == REG_ALL)
+ {
+ user->WriteNumeric(ERR_ALREADYREGISTERED, "%s :You are already registered. (Perhaps your IRC client does not have a /SERVER command).",user->nick.c_str());
+ }
+ else
+ {
+ user->WriteNumeric(ERR_NOTREGISTERED, "%s :You may not register as a server (servers have seperate ports from clients, change your config)",command.c_str());
+ }
return CMD_FAILURE;
}