mirror of
https://github.com/anope/anope.git
synced 2026-06-12 17:24:49 +02:00
Remove hard coded references to default access levels.
This commit is contained in:
@@ -92,6 +92,13 @@ public:
|
||||
{
|
||||
return new AccessChanAccess(this);
|
||||
}
|
||||
|
||||
void GetAccess(CommandSource& source, const Privilege *p, Anope::map<Anope::string> &access) override
|
||||
{
|
||||
auto it = defaultLevels.find(p->name);
|
||||
if (it != defaultLevels.end())
|
||||
access[_("Level")] = LevelToString(source, it->second);
|
||||
}
|
||||
};
|
||||
AccessAccessProvider *AccessAccessProvider::me;
|
||||
|
||||
|
||||
@@ -272,11 +272,12 @@ public:
|
||||
source.Reply(_(
|
||||
"Bans a given nick or mask on a channel. An optional expiry may "
|
||||
"be given to cause services to remove the ban after a set amount "
|
||||
"of time."
|
||||
"\n\n"
|
||||
"By default, limited to AOPs or those with level 5 access "
|
||||
"and above on the channel. Channel founders may ban masks."
|
||||
"of time. Channel founders may ban masks."
|
||||
));
|
||||
|
||||
source.Reply(" ");
|
||||
AccessProvider::SendAccess(source, "BAN");
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -84,6 +84,13 @@ public:
|
||||
{
|
||||
return new FlagsChanAccess(this);
|
||||
}
|
||||
|
||||
void GetAccess(CommandSource& source, const Privilege *p, Anope::map<Anope::string> &access) override
|
||||
{
|
||||
auto it = defaultFlags.find(p->name);
|
||||
if (it != defaultFlags.end())
|
||||
access[_("Flag")] = Anope::ToString(it->second);
|
||||
}
|
||||
};
|
||||
FlagsAccessProvider *FlagsAccessProvider::ap;
|
||||
|
||||
|
||||
@@ -95,11 +95,12 @@ public:
|
||||
source.Reply(_(
|
||||
"Tells %s to invite you or an optionally specified "
|
||||
"nick into the given channel."
|
||||
"\n\n"
|
||||
"By default, limited to AOPs or those with level 5 access and above "
|
||||
"on the channel."
|
||||
),
|
||||
source.service->nick.c_str());
|
||||
|
||||
source.Reply(" ");
|
||||
AccessProvider::SendAccess(source, "INVITE");
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -134,12 +134,11 @@ public:
|
||||
{
|
||||
this->SendSyntax(source);
|
||||
source.Reply(" ");
|
||||
source.Reply(_(
|
||||
"Kicks a specified nick from a channel."
|
||||
"\n\n"
|
||||
"By default, limited to AOPs or those with level 5 access "
|
||||
"and above on the channel. Channel founders can also specify masks."
|
||||
));
|
||||
source.Reply(_("Kicks a specified nick from a channel. Channel founders can also specify masks."));
|
||||
|
||||
source.Reply(" ");
|
||||
AccessProvider::SendAccess(source, "KICK");
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -128,11 +128,12 @@ public:
|
||||
"user from entering the given channel. If no channel is "
|
||||
"given, all bans affecting you in channels you have access "
|
||||
"in are removed."
|
||||
"\n\n"
|
||||
"By default, limited to AOPs or those with level 5 access and above "
|
||||
"on the channel."
|
||||
),
|
||||
source.service->nick.c_str());
|
||||
|
||||
source.Reply(" ");
|
||||
AccessProvider::SendAccess(source, "UNBAN");
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -100,6 +100,19 @@ public:
|
||||
{
|
||||
return new XOPChanAccess(this);
|
||||
}
|
||||
|
||||
void GetAccess(CommandSource& source, const Privilege *p, Anope::map<Anope::string> &access) override
|
||||
{
|
||||
for (const auto& xop : order)
|
||||
{
|
||||
const auto &privs = permissions[xop];
|
||||
if (std::find(privs.begin(), privs.end(), p->name) != privs.end())
|
||||
{
|
||||
access[_("XOP")] = xop;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
class CommandCSXOP final
|
||||
|
||||
Reference in New Issue
Block a user