aboutsummaryrefslogtreecommitdiffstats
path: root/src/users.cpp
diff options
context:
space:
mode:
authorGravatar Sadie Powell2021-12-14 16:56:48 +0000
committerGravatar Sadie Powell2021-12-14 16:56:48 +0000
commite9d54724e6cf9ff3772795cf5eed4b259700214f (patch)
treec7e06a9ca507df1db4eb5dc2e40a10da8198c086 /src/users.cpp
parentRevert "Remove support for defaults in find_{compiler,linker}_flags()". (diff)
parentIf a user has a unique username then include it in bans. (diff)
Merge branch 'insp3' into master.
Diffstat (limited to 'src/users.cpp')
-rw-r--r--src/users.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/users.cpp b/src/users.cpp
index 06bd58421..b5ce7cd91 100644
--- a/src/users.cpp
+++ b/src/users.cpp
@@ -83,6 +83,7 @@ User::User(const std::string& uid, Server* srv, Type type)
, server(srv)
, registered(REG_NONE)
, quitting(false)
+ , uniqueusername(false)
, usertype(type)
{
client_sa.sa.sa_family = AF_UNSPEC;
@@ -521,6 +522,7 @@ void LocalUser::CheckClass(bool clone_count)
}
this->nextping = ServerInstance->Time() + a->GetPingTime();
+ this->uniqueusername = a->uniqueusername;
}
bool LocalUser::CheckLines(bool doZline)
@@ -686,6 +688,12 @@ const std::string& User::GetIPString()
return cachedip;
}
+const std::string& User::GetBanIdent() const
+{
+ static const std::string wildcard = "*";
+ return uniqueusername ? ident : wildcard;
+}
+
const std::string& User::GetHost(bool uncloak) const
{
return uncloak ? GetRealHost() : GetDisplayedHost();