1
0
mirror of https://github.com/anope/anope.git synced 2026-06-12 19:14:47 +02:00

Move access entries for other access systems under an ALL option.

This should hopefully make it clearer that the access systems are
separate.
This commit is contained in:
Sadie Powell
2026-03-16 19:05:14 +00:00
parent 63032dc8d9
commit a657cb5edf
4 changed files with 69 additions and 13 deletions
+1
View File
@@ -141,6 +141,7 @@ namespace Language
#define CHAN_ACCESS_LIMIT_DEEP N_("You can only have %u access entry on a channel, including access entries from other channels.", "You can only have %u access entries on a channel, including access entries from other channels.")
#define CHAN_ACCESS_LEVEL_RANGE _("Access level must be between %d and %d inclusive.")
#define CHAN_ACCESS_MALFORMED _("You cannot add a malformed mask to an access list. Did you mean to add %s instead?")
#define CHAN_ACCESS_FOREIGN N_("%u access entry from other access systems not shown; use \002%s\033ALL\002 to view all access entries.", "%u access entries from other access systems not shown; use \002%s\033ALL\002 to view all access entries.")
#define CHAN_EXCEPTED _("\002%s\002 matches an except on %s and cannot be banned until the except has been removed.")
#define CHAN_INFO_HEADER _("Information about channel \002%s\002:")
#define CHAN_LIMIT_EXCEEDED _("You have already exceeded your limit of \002%d\002 channels.")
+15 -6
View File
@@ -16,8 +16,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Anope\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-03-16 15:17+0000\n"
"PO-Revision-Date: 2026-03-16 15:17+0000\n"
"POT-Creation-Date: 2026-03-16 19:04+0000\n"
"PO-Revision-Date: 2026-03-16 19:04+0000\n"
"Last-Translator: Sadie Powell <sadie@witchery.services>\n"
"Language-Team: English\n"
"Language: en_US\n"
@@ -531,7 +531,10 @@ msgstr ""
msgid "channel LIST [mask | list]"
msgstr ""
msgid "channel LIST [mask | +flags]"
msgid "channel LIST [mask | list] [ALL]"
msgstr ""
msgid "channel LIST [mask | +flags] [ALL]"
msgstr ""
msgid "channel LOCK {ADD|DEL|SET|LIST} [what]"
@@ -552,7 +555,7 @@ msgstr ""
msgid "channel VIEW [mask | entry-num | list]"
msgstr ""
msgid "channel VIEW [mask | list]"
msgid "channel VIEW [mask | list] [ALL]"
msgstr ""
#, c-format
@@ -1066,7 +1069,7 @@ msgid ""
"\n"
"The MODIFY command allows you to modify the access list. If the mask is not already on the access list it is added, then the changes are applied. If the mask has no more flags, then the mask is removed from the access list. Additionally, you may use +* or -* to add or remove all flags, respectively. You are only able to modify the access list if you have the proper permission on the channel, and even then you can only give other people access to the equivalent of what your access is.\n"
"\n"
"The LIST command allows you to list existing entries on the channel access list. If a mask is given, the mask is wildcard matched against all existing entries on the access list, and only those entries are returned. If a set of flags is given, only those on the access list with the specified flags are returned.\n"
"The LIST command allows you to list existing entries on the channel access list. If a mask is given, the mask is wildcard matched against all existing entries on the access list, and only those entries are returned. If a set of flags is given, only those on the access list with the specified flags are returned. The ALL option allows listing entries from other access systems as well as flags.\n"
"\n"
"The CLEAR command clears the channel access list. This requires channel founder access.\n"
"\n"
@@ -1193,6 +1196,12 @@ msgstr ""
msgid "%s's memo limit is %d."
msgstr ""
#, c-format
msgid "%u access entry from other access systems not shown; use %sALL to view all access entries."
msgid_plural "%u access entries from other access systems not shown; use %sALL to view all access entries."
msgstr[0] ""
msgstr[1] ""
#, c-format
msgid "%u channel"
msgid_plural "%u channels"
@@ -5335,7 +5344,7 @@ msgstr ""
msgid ""
"The %sDEL command removes the given nick from the access list. If a list of entry numbers is given, those entries are deleted. (See the example for LIST below.) You may remove yourself from an access list, even if you do not have access to modify that list otherwise.\n"
"\n"
"The %sLIST command displays the access list. If a wildcard mask is given, only those entries matching the mask are displayed. If a list of entry numbers is given, only those entries are shown.\n"
"The %sLIST command displays the access list. If a wildcard mask is given, only those entries matching the mask are displayed. If a list of entry numbers is given, only those entries are shown. The ALL option allows listing entries from other access systems as well as levels.\n"
"\n"
"The %sVIEW command displays the access list similar to %sLIST but shows the creator and last used time.\n"
"\n"
+34 -5
View File
@@ -427,6 +427,8 @@ private:
void ProcessList(CommandSource &source, ChannelInfo *ci, const std::vector<Anope::string> &params, ListFormatter &list)
{
const Anope::string &nick = params.size() > 2 ? params[2] : "";
const auto show_all = params.size() > 3 && params[3].equals_ci("ALL");
unsigned foreign = 0;
if (!ci->GetAccessCount())
source.Reply(_("%s access list is empty."), ci->name.c_str());
@@ -437,9 +439,16 @@ private:
{
ListFormatter &list;
ChannelInfo *ci;
bool show_all;
unsigned& foreign;
public:
AccessListCallback(ListFormatter &_list, ChannelInfo *_ci, const Anope::string &numlist) : NumberList(numlist, false), list(_list), ci(_ci)
AccessListCallback(ListFormatter &_list, ChannelInfo *_ci, const Anope::string &numlist, bool _show_all, unsigned &_foreign)
: NumberList(numlist, false)
, list(_list)
, ci(_ci)
, show_all(_show_all)
, foreign(_foreign)
{
}
@@ -449,11 +458,16 @@ private:
return;
const ChanAccess *access = ci->GetAccess(number - 1);
if (!show_all && access->provider->name != "access/access")
{
foreign++;
return;
}
AddEntry(this->list, ci, access, number);
}
}
nl_list(list, ci, nick);
nl_list(list, ci, nick, show_all, foreign);
nl_list.Process();
}
else
@@ -465,6 +479,12 @@ private:
if (!nick.empty() && !Anope::Match(access->Mask(), nick))
continue;
if (!show_all && access->provider->name != "access/access")
{
foreign++;
continue;
}
AddEntry(list, ci, access, i + 1);
}
}
@@ -477,6 +497,14 @@ private:
list.SendTo(source);
source.Reply(_("End of access list"));
}
if (foreign)
{
const auto full_command = Anope::Format("%s %s %s %s", source.command.c_str(),
ci->name.c_str(), params[1].upper().c_str(), nick.empty() ? "*" : nick.c_str()).nobreak();
source.Reply(foreign, CHAN_ACCESS_FOREIGN, foreign, full_command.c_str());
}
}
void DoList(CommandSource &source, ChannelInfo *ci, const std::vector<Anope::string> &params)
@@ -542,8 +570,8 @@ public:
this->SetDesc(_("Modify the list of privileged users"));
this->SetSyntax(_("\037channel\037 ADD \037mask\037 \037level\037 [\037description\037]"));
this->SetSyntax(_("\037channel\037 DEL {\037mask\037 | \037entry-num\037 | \037list\037}"));
this->SetSyntax(_("\037channel\037 LIST [\037mask\037 | \037list\037]"));
this->SetSyntax(_("\037channel\037 VIEW [\037mask\037 | \037list\037]"));
this->SetSyntax(_("\037channel\037 LIST [\037mask\037 | \037list\037] [ALL]"));
this->SetSyntax(_("\037channel\037 VIEW [\037mask\037 | \037list\037] [ALL]"));
this->SetSyntax(_("\037channel\037 CLEAR"));
}
@@ -646,7 +674,8 @@ public:
"The \002%s\033LIST\002 command displays the access list. If "
"a wildcard mask is given, only those entries matching the "
"mask are displayed. If a list of entry numbers is given, "
"only those entries are shown."
"only those entries are shown. The \002ALL\002 option allows "
"listing entries from other access systems as well as levels."
"\n\n"
"The \002%s\033VIEW\002 command displays the access list similar "
"to \002%s\033LIST\002 but shows the creator and last used time."
+19 -2
View File
@@ -331,6 +331,7 @@ class CommandCSFlags final
static void DoList(CommandSource &source, ChannelInfo *ci, const std::vector<Anope::string> &params)
{
const Anope::string &arg = params.size() > 2 ? params[2] : "";
const auto show_all = params.size() > 3 && params[3].equals_ci("ALL");
if (!ci->GetAccessCount())
{
@@ -348,6 +349,7 @@ class CommandCSFlags final
});
unsigned count = 0;
unsigned foreign = 0;
for (unsigned i = 0, end = ci->GetAccessCount(); i < end; ++i)
{
const ChanAccess *access = ci->GetAccess(i);
@@ -368,6 +370,12 @@ class CommandCSFlags final
continue;
}
if (!show_all && access->provider->name != "access/flags")
{
foreign++;
continue;
}
ListFormatter::ListEntry entry;
++count;
entry["Number"] = Anope::ToString(i + 1);
@@ -390,6 +398,14 @@ class CommandCSFlags final
else
source.Reply(_("End of access list - %d/%d entries shown."), count, ci->GetAccessCount());
}
if (foreign)
{
const auto full_command = Anope::Format("%s %s LIST %s", source.command.c_str(),
ci->name.c_str(), arg.empty() ? "*" : arg.c_str()).nobreak();
source.Reply(foreign, CHAN_ACCESS_FOREIGN, foreign, full_command.c_str());
}
}
void DoClear(CommandSource &source, ChannelInfo *ci)
@@ -414,7 +430,7 @@ public:
{
this->SetDesc(_("Modify the list of privileged users"));
this->SetSyntax(_("\037channel\037 [MODIFY] \037mask\037 \037changes\037 [\037description\037]"));
this->SetSyntax(_("\037channel\037 LIST [\037mask\037 | +\037flags\037]"));
this->SetSyntax(_("\037channel\037 LIST [\037mask\037 | +\037flags\037] [ALL]"));
this->SetSyntax(_("\037channel\037 CLEAR"));
}
@@ -487,7 +503,8 @@ public:
"The \002LIST\002 command allows you to list existing entries on the channel access list. "
"If a mask is given, the mask is wildcard matched against all existing entries on the "
"access list, and only those entries are returned. If a set of flags is given, only those "
"on the access list with the specified flags are returned."
"on the access list with the specified flags are returned. The \002ALL\002 option allows "
"listing entries from other access systems as well as flags."
"\n\n"
"The \002CLEAR\002 command clears the channel access list. This requires channel founder access."
"\n\n"