mirror of
https://github.com/anope/anope.git
synced 2026-07-08 11:03:14 +02:00
Build buffers a bit smarter in cs_access/cs_xop/help.
This commit is contained in:
@@ -297,7 +297,7 @@ private:
|
||||
ChannelInfo *ci;
|
||||
Command *c;
|
||||
unsigned deleted = 0;
|
||||
Anope::string Nicks;
|
||||
Anope::string nicks;
|
||||
bool denied = false;
|
||||
bool override = false;
|
||||
public:
|
||||
@@ -315,9 +315,9 @@ private:
|
||||
source.Reply(_("No matching entries on %s access list."), ci->name.c_str());
|
||||
else
|
||||
{
|
||||
Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, c, ci) << "to delete " << Nicks;
|
||||
Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, c, ci) << "to delete " << nicks;
|
||||
if (deleted == 1)
|
||||
source.Reply(_("Deleted %s from %s access list."), Nicks.c_str(), ci->name.c_str());
|
||||
source.Reply(_("Deleted %s from %s access list."), nicks.c_str(), ci->name.c_str());
|
||||
|
||||
else
|
||||
source.Reply(deleted, N_("Deleted %d entry from %s access list.", "Deleted %d entries from %s access list."), deleted, ci->name.c_str());
|
||||
@@ -341,10 +341,9 @@ private:
|
||||
}
|
||||
|
||||
++deleted;
|
||||
if (!Nicks.empty())
|
||||
Nicks += ", " + access->Mask();
|
||||
else
|
||||
Nicks = access->Mask();
|
||||
if (!nicks.empty())
|
||||
nicks += ", ";
|
||||
nicks += access->Mask();
|
||||
|
||||
ci->EraseAccess(Number - 1);
|
||||
|
||||
|
||||
@@ -338,9 +338,8 @@ private:
|
||||
|
||||
++deleted;
|
||||
if (!nicks.empty())
|
||||
nicks += ", " + caccess->Mask();
|
||||
else
|
||||
nicks = caccess->Mask();
|
||||
nicks += ", ";
|
||||
nicks += caccess->Mask();
|
||||
|
||||
ci->EraseAccess(number - 1);
|
||||
FOREACH_MOD(OnAccessDel, (ci, source, caccess));
|
||||
@@ -556,16 +555,18 @@ public:
|
||||
Anope::string buf;
|
||||
for (const auto &permission : permissions[cmd])
|
||||
{
|
||||
buf += ", " + permission;
|
||||
if (!buf.empty())
|
||||
buf += ", ";
|
||||
buf += permission;
|
||||
if (buf.length() > 75)
|
||||
{
|
||||
source.Reply(" %s", buf.substr(2).c_str());
|
||||
source.Reply(" %s", buf.c_str());
|
||||
buf.clear();
|
||||
}
|
||||
}
|
||||
if (!buf.empty())
|
||||
{
|
||||
source.Reply(" %s", buf.substr(2).c_str());
|
||||
source.Reply(" %s", buf.c_str());
|
||||
buf.clear();
|
||||
}
|
||||
|
||||
|
||||
+5
-3
@@ -102,17 +102,19 @@ public:
|
||||
Anope::string buf;
|
||||
for (const auto &c_name : cmds)
|
||||
{
|
||||
buf += ", " + c_name;
|
||||
if (!buf.empty())
|
||||
buf += ", ";
|
||||
buf += c_name;
|
||||
|
||||
if (buf.length() > help_wrap_len)
|
||||
{
|
||||
source.Reply(" %s", buf.substr(2).c_str());
|
||||
source.Reply(" %s", buf.c_str());
|
||||
buf.clear();
|
||||
}
|
||||
}
|
||||
if (buf.length() > 2)
|
||||
{
|
||||
source.Reply(" %s", buf.substr(2).c_str());
|
||||
source.Reply(" %s", buf.c_str());
|
||||
buf.clear();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user