summaryrefslogtreecommitdiff
path: root/src/commands
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2014-01-21 18:44:08 +0100
committerAttila Molnar <attilamolnar@hush.com>2014-01-21 18:44:08 +0100
commite244cb2c63b1ac1d85bdbb4691f7b1bd940ae804 (patch)
tree5a69b0efe6c0b7ab88925d3d066271ec40845e23 /src/commands
parentfead8af2b767cb5591536a3c98babf6b35194a66 (diff)
parent7dd831383f7506e49f568d0684ee1ecb1f5dc90f (diff)
Merge insp20
Diffstat (limited to 'src/commands')
-rw-r--r--src/commands/cmd_admin.cpp7
-rw-r--r--src/commands/cmd_commands.cpp6
-rw-r--r--src/commands/cmd_info.cpp7
-rw-r--r--src/commands/cmd_modules.cpp9
-rw-r--r--src/commands/cmd_whois.cpp16
5 files changed, 27 insertions, 18 deletions
diff --git a/src/commands/cmd_admin.cpp b/src/commands/cmd_admin.cpp
index 3a3eed346..0d6c235f0 100644
--- a/src/commands/cmd_admin.cpp
+++ b/src/commands/cmd_admin.cpp
@@ -30,7 +30,12 @@ class CommandAdmin : public Command
public:
/** Constructor for admin.
*/
- CommandAdmin(Module* parent) : Command(parent,"ADMIN",0,0) { syntax = "[<servername>]"; }
+ CommandAdmin(Module* parent) : Command(parent,"ADMIN",0,0)
+ {
+ Penalty = 2;
+ syntax = "[<servername>]";
+ }
+
/** 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_commands.cpp b/src/commands/cmd_commands.cpp
index 190c883bd..c45616061 100644
--- a/src/commands/cmd_commands.cpp
+++ b/src/commands/cmd_commands.cpp
@@ -30,7 +30,11 @@ class CommandCommands : public Command
public:
/** Constructor for commands.
*/
- CommandCommands ( Module* parent) : Command(parent,"COMMANDS",0,0) { }
+ CommandCommands(Module* parent) : Command(parent,"COMMANDS",0,0)
+ {
+ Penalty = 3;
+ }
+
/** 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_info.cpp b/src/commands/cmd_info.cpp
index b3f146c30..7ee1c4d3b 100644
--- a/src/commands/cmd_info.cpp
+++ b/src/commands/cmd_info.cpp
@@ -32,7 +32,12 @@ class CommandInfo : public Command
public:
/** Constructor for info.
*/
- CommandInfo ( Module* parent) : Command(parent,"INFO") { syntax = "[<servermask>]"; }
+ CommandInfo(Module* parent) : Command(parent,"INFO")
+ {
+ Penalty = 4;
+ syntax = "[<servername>]";
+ }
+
/** 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_modules.cpp b/src/commands/cmd_modules.cpp
index fe199e7a4..d9fa7d5d5 100644
--- a/src/commands/cmd_modules.cpp
+++ b/src/commands/cmd_modules.cpp
@@ -31,7 +31,12 @@ class CommandModules : public Command
public:
/** Constructor for modules.
*/
- CommandModules ( Module* parent) : Command(parent,"MODULES",0,0) { syntax = "[server]"; }
+ CommandModules(Module* parent) : Command(parent,"MODULES",0,0)
+ {
+ Penalty = 4;
+ syntax = "[<servername>]";
+ }
+
/** Handle command.
* @param parameters The parameters to the comamnd
* @param pcnt The number of parameters passed to teh command
@@ -74,7 +79,7 @@ CmdResult CommandModules::Handle (const std::vector<std::string>& parameters, Us
Module* m = i->second;
Version V = m->GetVersion();
- if (user->HasPrivPermission("servers/auspex"))
+ if (IS_LOCAL(user) && user->HasPrivPermission("servers/auspex"))
{
std::string flags("SvcC");
int pos = 0;
diff --git a/src/commands/cmd_whois.cpp b/src/commands/cmd_whois.cpp
index 7e67676ed..e8a751fa0 100644
--- a/src/commands/cmd_whois.cpp
+++ b/src/commands/cmd_whois.cpp
@@ -80,7 +80,7 @@ void CommandWhois::SplitChanList(User* source, User* dest, const std::string& cl
{
std::string line;
std::ostringstream prefix;
- std::string::size_type start, pos, length;
+ std::string::size_type start, pos;
prefix << dest->nick << " :";
line = prefix.str();
@@ -88,23 +88,13 @@ void CommandWhois::SplitChanList(User* source, User* dest, const std::string& cl
for (start = 0; (pos = cl.find(' ', start)) != std::string::npos; start = pos+1)
{
- length = (pos == std::string::npos) ? cl.length() : pos;
-
- if (line.length() + namelen + length - start > 510)
+ if (line.length() + namelen + pos - start > 510)
{
ServerInstance->SendWhoisLine(source, dest, 319, line);
line = prefix.str();
}
- if(pos == std::string::npos)
- {
- line.append(cl.substr(start, length - start));
- break;
- }
- else
- {
- line.append(cl.substr(start, length - start + 1));
- }
+ line.append(cl.substr(start, pos - start + 1));
}
if (line.length() != prefix.str().length())