summaryrefslogtreecommitdiff
path: root/modules/commands
diff options
context:
space:
mode:
Diffstat (limited to 'modules/commands')
-rw-r--r--modules/commands/cs_access.cpp11
-rw-r--r--modules/commands/cs_flags.cpp11
-rw-r--r--modules/commands/cs_xop.cpp11
3 files changed, 30 insertions, 3 deletions
diff --git a/modules/commands/cs_access.cpp b/modules/commands/cs_access.cpp
index b8b5aa546..aa32d29ef 100644
--- a/modules/commands/cs_access.cpp
+++ b/modules/commands/cs_access.cpp
@@ -124,7 +124,16 @@ class CommandCSAccess : public Command
bool override = !ci->AccessFor(u).HasPriv("ACCESS_CHANGE") || (level >= u_level && !u_access.Founder);
if (mask.find_first_of("!*@") == Anope::string::npos && findnick(mask) == NULL)
- mask += "!*@*";
+ {
+ User *targ = finduser(mask);
+ if (targ != NULL)
+ mask = "*!*@" + targ->GetDisplayedHost();
+ else
+ {
+ source.Reply(NICK_X_NOT_REGISTERED, mask.c_str());
+ return;
+ }
+ }
for (unsigned i = ci->GetAccessCount(); i > 0; --i)
{
diff --git a/modules/commands/cs_flags.cpp b/modules/commands/cs_flags.cpp
index f5dc7fe1c..1dd10bbb6 100644
--- a/modules/commands/cs_flags.cpp
+++ b/modules/commands/cs_flags.cpp
@@ -89,7 +89,16 @@ class CommandCSFlags : public Command
AccessGroup u_access = ci->AccessFor(u);
if (mask.find_first_of("!*@") == Anope::string::npos && findnick(mask) == NULL)
- mask += "!*@*";
+ {
+ User *targ = finduser(mask);
+ if (targ != NULL)
+ mask = "*!*@" + targ->GetDisplayedHost();
+ else
+ {
+ source.Reply(NICK_X_NOT_REGISTERED, mask.c_str());
+ return;
+ }
+ }
ChanAccess *current = NULL;
std::set<char> current_flags;
diff --git a/modules/commands/cs_xop.cpp b/modules/commands/cs_xop.cpp
index 5ca488535..7935467c2 100644
--- a/modules/commands/cs_xop.cpp
+++ b/modules/commands/cs_xop.cpp
@@ -226,7 +226,16 @@ class XOPBase : public Command
}
if (mask.find_first_of("!*@") == Anope::string::npos && findnick(mask) == NULL)
- mask += "!*@*";
+ {
+ User *targ = finduser(mask);
+ if (targ != NULL)
+ mask = "*!*@" + targ->GetDisplayedHost();
+ else
+ {
+ source.Reply(NICK_X_NOT_REGISTERED, mask.c_str());
+ return;
+ }
+ }
for (unsigned i = 0; i < ci->GetAccessCount(); ++i)
{