summaryrefslogtreecommitdiff
path: root/modules/commands/cs_seen.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/cs_seen.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/cs_seen.cpp')
-rw-r--r--modules/commands/cs_seen.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/modules/commands/cs_seen.cpp b/modules/commands/cs_seen.cpp
index 41f8ee97c..80bc8e548 100644
--- a/modules/commands/cs_seen.cpp
+++ b/modules/commands/cs_seen.cpp
@@ -236,9 +236,14 @@ class CommandSeen : public Command
AccessGroup ag = source.c->ci->AccessFor(na->nc);
time_t last = 0;
- for (unsigned i = 0; i < ag.size(); ++i)
+ for (unsigned int i = 0; i < ag.paths.size(); ++i)
{
- ChanAccess *a = ag[i];
+ ChanAccess::Path &p = ag.paths[i];
+
+ if (p.empty())
+ continue;
+
+ ChanAccess *a = p[p.size() - 1];
if (a->GetAccount() == na->nc && a->last_seen > last)
last = a->last_seen;