From 4e2ca31cf5fc874ab928dc4d3735f4345a910d0d Mon Sep 17 00:00:00 2001 From: Adam Date: Sat, 13 Feb 2016 14:16:29 -0500 Subject: Rewrite access path system to be simplier and use recursion Show where access is "from" in chanserv/status --- modules/commands/cs_seen.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'modules/commands/cs_seen.cpp') 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; -- cgit