summaryrefslogtreecommitdiff
path: root/modules/commands/ns_alist.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2016-02-13 14:16:29 -0500
committerAdam <Adam@anope.org>2016-02-13 14:16:29 -0500
commit4e2ca31cf5fc874ab928dc4d3735f4345a910d0d (patch)
tree1590da2a86eb164389dd781870648d8f3824f9a3 /modules/commands/ns_alist.cpp
parentaddd2a1987dccff6ad4c8a68f5c48c9f850912ec (diff)
Rewrite access path system to be simplier and use recursion
Show where access is "from" in chanserv/status
Diffstat (limited to 'modules/commands/ns_alist.cpp')
-rw-r--r--modules/commands/ns_alist.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/modules/commands/ns_alist.cpp b/modules/commands/ns_alist.cpp
index d273ec59f..6ccbe94ba 100644
--- a/modules/commands/ns_alist.cpp
+++ b/modules/commands/ns_alist.cpp
@@ -86,8 +86,17 @@ class CommandNSAList : public Command
entry["Number"] = stringify(chan_count);
entry["Channel"] = (ci->HasExt("CS_NO_EXPIRE") ? "!" : "") + ci->name;
- for (unsigned j = 0; j < access.size(); ++j)
- entry["Access"] = entry["Access"] + ", " + access[j]->AccessSerialize();
+ for (unsigned j = 0; j < access.paths.size(); ++j)
+ {
+ ChanAccess::Path &p = access.paths[i];
+
+ // not interested in indirect access
+ if (p.size() != 1)
+ continue;
+
+ ChanAccess *a = p[0];
+ entry["Access"] = entry["Access"] + ", " + a->AccessSerialize();
+ }
entry["Access"] = entry["Access"].substr(2);
entry["Description"] = ci->desc;
list.AddEntry(entry);