summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/regchannel.h4
-rw-r--r--modules/commands/ns_alist.cpp2
-rw-r--r--src/regchannel.cpp12
3 files changed, 10 insertions, 8 deletions
diff --git a/include/regchannel.h b/include/regchannel.h
index 50e0ceed2..7713db056 100644
--- a/include/regchannel.h
+++ b/include/regchannel.h
@@ -133,8 +133,8 @@ class CoreExport ChannelInfo : public Serializable, public Extensible
/** Retrieve the access for a user or group in the form of a vector of access entries
* (as multiple entries can affect a single user).
*/
- AccessGroup AccessFor(const User *u);
- AccessGroup AccessFor(const NickCore *nc);
+ AccessGroup AccessFor(const User *u, bool updateLastUsed = true);
+ AccessGroup AccessFor(const NickCore *nc, bool updateLastUsed = true);
/** Get the size of the accss vector for this channel
* @return The access vector size
diff --git a/modules/commands/ns_alist.cpp b/modules/commands/ns_alist.cpp
index 46981dc95..23389de22 100644
--- a/modules/commands/ns_alist.cpp
+++ b/modules/commands/ns_alist.cpp
@@ -78,7 +78,7 @@ class CommandNSAList : public Command
continue;
}
- AccessGroup access = ci->AccessFor(nc);
+ AccessGroup access = ci->AccessFor(nc, false);
if (access.empty())
continue;
diff --git a/src/regchannel.cpp b/src/regchannel.cpp
index 2b17c72ca..ebc542547 100644
--- a/src/regchannel.cpp
+++ b/src/regchannel.cpp
@@ -385,7 +385,7 @@ ChanAccess *ChannelInfo::GetAccess(unsigned index) const
return acc;
}
-AccessGroup ChannelInfo::AccessFor(const User *u)
+AccessGroup ChannelInfo::AccessFor(const User *u, bool updateLastUsed)
{
AccessGroup group;
@@ -414,7 +414,8 @@ AccessGroup ChannelInfo::AccessFor(const User *u)
if (group.founder || !group.empty())
{
- this->last_used = Anope::CurTime;
+ if (updateLastUsed)
+ this->last_used = Anope::CurTime;
for (unsigned i = 0; i < group.size(); ++i)
group[i]->last_seen = Anope::CurTime;
@@ -423,7 +424,7 @@ AccessGroup ChannelInfo::AccessFor(const User *u)
return group;
}
-AccessGroup ChannelInfo::AccessFor(const NickCore *nc)
+AccessGroup ChannelInfo::AccessFor(const NickCore *nc, bool updateLastUsed)
{
AccessGroup group;
@@ -439,9 +440,10 @@ AccessGroup ChannelInfo::AccessFor(const NickCore *nc)
}
if (group.founder || !group.empty())
- this->last_used = Anope::CurTime;
+ if (updateLastUsed)
+ this->last_used = Anope::CurTime;
- /* don't update access last seen here, this isn't the user requesting access */
+ /* don't update access last seen here, this isn't the user requesting access */
return group;
}