summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/chanserv/cs_access.cpp7
-rw-r--r--modules/chanserv/cs_flags.cpp6
-rw-r--r--modules/chanserv/cs_xop.cpp4
3 files changed, 15 insertions, 2 deletions
diff --git a/modules/chanserv/cs_access.cpp b/modules/chanserv/cs_access.cpp
index 4c3981a5e..b7c39ac6d 100644
--- a/modules/chanserv/cs_access.cpp
+++ b/modules/chanserv/cs_access.cpp
@@ -87,6 +87,7 @@ class CommandCSAccess final
void DoAdd(CommandSource &source, ChannelInfo *ci, const std::vector<Anope::string> &params)
{
Anope::string mask = params[2];
+ Anope::string description = params.size() > 4 ? params[4] : "";
Privilege *p = NULL;
int level = ACCESS_INVALID;
@@ -172,7 +173,11 @@ class CommandCSAccess final
{
User *targ = User::Find(mask, true);
if (targ != NULL)
+ {
mask = "*!*@" + targ->GetDisplayedHost();
+ if (description.empty())
+ description = targ->nick;
+ }
else
{
source.Reply(NICK_X_NOT_REGISTERED, mask.c_str());
@@ -216,7 +221,7 @@ class CommandCSAccess final
access->level = level;
access->last_seen = 0;
access->created = Anope::CurTime;
- access->description = params.size() > 4 ? params[4] : "";
+ access->description = description;
ci->AddAccess(access);
FOREACH_MOD(OnAccessAdd, (ci, source, access));
diff --git a/modules/chanserv/cs_flags.cpp b/modules/chanserv/cs_flags.cpp
index cdba434dc..396447fbc 100644
--- a/modules/chanserv/cs_flags.cpp
+++ b/modules/chanserv/cs_flags.cpp
@@ -79,7 +79,7 @@ FlagsAccessProvider *FlagsAccessProvider::ap;
class CommandCSFlags final
: public Command
{
- void DoModify(CommandSource &source, ChannelInfo *ci, Anope::string mask, const Anope::string &flags, const Anope::string &description)
+ void DoModify(CommandSource &source, ChannelInfo *ci, Anope::string mask, const Anope::string &flags, Anope::string description)
{
if (flags.empty())
{
@@ -131,7 +131,11 @@ class CommandCSFlags final
{
User *targ = User::Find(mask, true);
if (targ != NULL)
+ {
mask = "*!*@" + targ->GetDisplayedHost();
+ if (description.empty())
+ description = targ->nick;
+ }
else
{
source.Reply(NICK_X_NOT_REGISTERED, mask.c_str());
diff --git a/modules/chanserv/cs_xop.cpp b/modules/chanserv/cs_xop.cpp
index 19fbf0c37..db8456492 100644
--- a/modules/chanserv/cs_xop.cpp
+++ b/modules/chanserv/cs_xop.cpp
@@ -179,7 +179,11 @@ private:
{
User *targ = User::Find(mask, true);
if (targ != NULL)
+ {
mask = "*!*@" + targ->GetDisplayedHost();
+ if (description.empty())
+ description = targ->nick;
+ }
else
{
source.Reply(NICK_X_NOT_REGISTERED, mask.c_str());