summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2024-11-11 17:10:24 +0000
committerSadie Powell <sadie@witchery.services>2024-11-11 17:13:01 +0000
commitdf1c6176b38eea8d8889604699012ac8b172e341 (patch)
tree73a467a7df0882541cd4f9cb5e249972647283f5
parent8634594cd1a11d6786e7da44679483718f47cc09 (diff)
parent96ccfe4cbe9948206ac2d6854778f9a268d2476f (diff)
Merge branch '2.0' into 2.1.
-rw-r--r--modules/chanstats.cpp6
-rw-r--r--modules/dnsbl.cpp2
-rw-r--r--modules/fantasy.cpp2
-rw-r--r--modules/greet.cpp2
-rw-r--r--modules/irc2sql/irc2sql.cpp4
-rw-r--r--modules/ldap_authentication.cpp2
-rw-r--r--modules/ldap_oper.cpp2
-rw-r--r--modules/memoserv/memoserv.cpp2
-rw-r--r--modules/nickserv/nickserv.cpp2
-rw-r--r--modules/nickserv/ns_identify.cpp2
-rw-r--r--modules/nickserv/ns_set.cpp6
-rw-r--r--modules/protocol/unrealircd.cpp2
-rw-r--r--modules/sql_oper.cpp2
-rw-r--r--modules/xmlrpc_main.cpp2
-rw-r--r--src/language.cpp2
-rw-r--r--src/memos.cpp2
16 files changed, 21 insertions, 21 deletions
diff --git a/modules/chanstats.cpp b/modules/chanstats.cpp
index 5c7cfca62..f3eb9b1fb 100644
--- a/modules/chanstats.cpp
+++ b/modules/chanstats.cpp
@@ -212,7 +212,7 @@ class MChanstats final
Anope::string GetDisplay(User *u)
{
- if (u && u->Account() && ns_stats.HasExt(u->Account()))
+ if (u && u->IsIdentified() && ns_stats.HasExt(u->Account()))
return u->Account()->display;
else
return "";
@@ -532,7 +532,7 @@ public:
void OnTopicUpdated(User *source, Channel *c, const Anope::string &user, const Anope::string &topic) override
{
- if (!source || !source->Account() || !c->ci || !cs_stats.HasExt(c->ci))
+ if (!source || !source->IsIdentified() || !c->ci || !cs_stats.HasExt(c->ci))
return;
query = "CALL " + prefix + "chanstats_proc_update(@channel@, @nick@, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1);";
query.SetValue("channel", c->name);
@@ -555,7 +555,7 @@ public:
private:
void OnModeChange(Channel *c, User *u)
{
- if (!u || !u->Account() || !c->ci || !cs_stats.HasExt(c->ci))
+ if (!u || !u->IsIdentified() || !c->ci || !cs_stats.HasExt(c->ci))
return;
query = "CALL " + prefix + "chanstats_proc_update(@channel@, @nick@, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0);";
diff --git a/modules/dnsbl.cpp b/modules/dnsbl.cpp
index af4d686e1..9a17a04ed 100644
--- a/modules/dnsbl.cpp
+++ b/modules/dnsbl.cpp
@@ -67,7 +67,7 @@ public:
if (!blacklist.replies.empty() && !reply)
return;
- if (reply && reply->allow_account && user->Account())
+ if (reply && reply->allow_account && user->IsIdentified())
return;
Anope::string reason = this->blacklist.reason, addr = user->ip.addr();
diff --git a/modules/fantasy.cpp b/modules/fantasy.cpp
index 0b3e642aa..20ccd0570 100644
--- a/modules/fantasy.cpp
+++ b/modules/fantasy.cpp
@@ -169,7 +169,7 @@ public:
}
// Command requires registered users only
- if (!cmd->AllowUnregistered() && !u->Account())
+ if (!cmd->AllowUnregistered() && !u->IsIdentified())
return;
if (params.size() < cmd->min_params)
diff --git a/modules/greet.cpp b/modules/greet.cpp
index 670ff37ba..13c51a1d5 100644
--- a/modules/greet.cpp
+++ b/modules/greet.cpp
@@ -192,7 +192,7 @@ public:
* to has synced, or we'll get greet-floods when the net
* recovers from a netsplit. -GD
*/
- if (!c->ci || !c->ci->bi || !user->server->IsSynced() || !user->Account())
+ if (!c->ci || !c->ci->bi || !user->server->IsSynced() || !user->IsIdentified())
return;
Anope::string *greet = ns_greet.Get(user->Account());
diff --git a/modules/irc2sql/irc2sql.cpp b/modules/irc2sql/irc2sql.cpp
index 917e37fd3..a587b3f5e 100644
--- a/modules/irc2sql/irc2sql.cpp
+++ b/modules/irc2sql/irc2sql.cpp
@@ -107,7 +107,7 @@ void IRC2SQL::OnUserConnect(User *u, bool &exempt)
query.SetValue("ident", u->GetIdent());
query.SetValue("vident", u->GetVIdent());
query.SetValue("secure", u->IsSecurelyConnected() ? "Y" : "N");
- query.SetValue("account", u->Account() ? u->Account()->display : "");
+ query.SetValue("account", u->IsIdentified() ? u->Account()->display : "");
query.SetValue("fingerprint", u->fingerprint);
query.SetValue("signon", u->signon);
query.SetValue("server", u->server->GetName());
@@ -175,7 +175,7 @@ void IRC2SQL::OnUserLogin(User *u)
{
query = "UPDATE `" + prefix + "user` SET account=@account@ WHERE nick=@nick@";
query.SetValue("nick", u->nick);
- query.SetValue("account", u->Account() ? u->Account()->display : "");
+ query.SetValue("account", u->IsIdentified() ? u->Account()->display : "");
this->RunQuery(query);
}
diff --git a/modules/ldap_authentication.cpp b/modules/ldap_authentication.cpp
index 530c9f85e..dbca68e58 100644
--- a/modules/ldap_authentication.cpp
+++ b/modules/ldap_authentication.cpp
@@ -145,7 +145,7 @@ public:
{
User *u = User::Find(uid);
- if (!u || !u->Account() || r.empty())
+ if (!u || !u->IsIdentified() || r.empty())
return;
try
diff --git a/modules/ldap_oper.cpp b/modules/ldap_oper.cpp
index 62749f957..5e73c6847 100644
--- a/modules/ldap_oper.cpp
+++ b/modules/ldap_oper.cpp
@@ -24,7 +24,7 @@ public:
void OnResult(const LDAPResult &r) override
{
- if (!u || !u->Account())
+ if (!u || !u->IsIdentified())
return;
NickCore *nc = u->Account();
diff --git a/modules/memoserv/memoserv.cpp b/modules/memoserv/memoserv.cpp
index 219d4b33e..c6d927460 100644
--- a/modules/memoserv/memoserv.cpp
+++ b/modules/memoserv/memoserv.cpp
@@ -100,7 +100,7 @@ public:
{
if (ci->AccessFor(cu->user).HasPriv("MEMO"))
{
- if (cu->user->Account() && cu->user->Account()->HasExt("MEMO_RECEIVE"))
+ if (cu->user->IsIdentified() && cu->user->Account()->HasExt("MEMO_RECEIVE"))
cu->user->SendMessage(MemoServ, MEMO_NEW_X_MEMO_ARRIVED, ci->name.c_str(), MemoServ->GetQueryCommand().c_str(), ci->name.c_str(), mi->memos->size());
}
}
diff --git a/modules/nickserv/nickserv.cpp b/modules/nickserv/nickserv.cpp
index d38119d69..04dd2e1e2 100644
--- a/modules/nickserv/nickserv.cpp
+++ b/modules/nickserv/nickserv.cpp
@@ -400,7 +400,7 @@ public:
const NickAlias *na = NickAlias::Find(u->nick);
const Anope::string &unregistered_notice = Config->GetModule(this)->Get<const Anope::string>("unregistered_notice");
- if (!Config->GetModule("nickserv")->Get<bool>("nonicknameownership") && !unregistered_notice.empty() && !na && !u->Account())
+ if (!Config->GetModule("nickserv")->Get<bool>("nonicknameownership") && !unregistered_notice.empty() && !na && !u->IsIdentified())
u->SendMessage(NickServ, unregistered_notice.replace_all_cs("%n", u->nick));
else if (na && !u->IsIdentified(true))
this->Validate(u);
diff --git a/modules/nickserv/ns_identify.cpp b/modules/nickserv/ns_identify.cpp
index e945c6ece..54175bba9 100644
--- a/modules/nickserv/ns_identify.cpp
+++ b/modules/nickserv/ns_identify.cpp
@@ -84,7 +84,7 @@ public:
return;
}
- if (u->Account() && na && u->Account() == na->nc)
+ if (u->IsIdentified() && na && u->Account() == na->nc)
{
source.Reply(_("You are already identified."));
return;
diff --git a/modules/nickserv/ns_set.cpp b/modules/nickserv/ns_set.cpp
index f8391a519..bb212b678 100644
--- a/modules/nickserv/ns_set.cpp
+++ b/modules/nickserv/ns_set.cpp
@@ -1077,7 +1077,7 @@ public:
if (chan->ci)
{
/* Only give modes if autoop is set */
- give_modes &= !user->Account() || autoop.HasExt(user->Account());
+ give_modes &= !user->IsIdentified() || autoop.HasExt(user->Account());
}
}
@@ -1110,13 +1110,13 @@ public:
void OnUserModeSet(const MessageSource &setter, User *u, const Anope::string &mname) override
{
- if (u->Account() && setter.GetUser() == u)
+ if (u->IsIdentified() && setter.GetUser() == u)
u->Account()->last_modes = u->GetModeList();
}
void OnUserModeUnset(const MessageSource &setter, User *u, const Anope::string &mname) override
{
- if (u->Account() && setter.GetUser() == u)
+ if (u->IsIdentified() && setter.GetUser() == u)
u->Account()->last_modes = u->GetModeList();
}
diff --git a/modules/protocol/unrealircd.cpp b/modules/protocol/unrealircd.cpp
index ebab51d3c..1e0cb713b 100644
--- a/modules/protocol/unrealircd.cpp
+++ b/modules/protocol/unrealircd.cpp
@@ -588,7 +588,7 @@ namespace UnrealExtBan
if (e->GetMask() == "0" && !u->Account()) /* ~a:0 is special and matches all unauthenticated users */
return true;
- return u->Account() && Anope::Match(u->Account()->display, e->GetMask());
+ return u->IsIdentified() && Anope::Match(u->Account()->display, e->GetMask());
}
};
diff --git a/modules/sql_oper.cpp b/modules/sql_oper.cpp
index af2b40346..d0912268c 100644
--- a/modules/sql_oper.cpp
+++ b/modules/sql_oper.cpp
@@ -48,7 +48,7 @@ public:
{
SQLOperResultDeleter d(this);
- if (!user || !user->Account())
+ if (!user || !user->IsIdentified())
return;
if (r.Rows() == 0)
diff --git a/modules/xmlrpc_main.cpp b/modules/xmlrpc_main.cpp
index abf648da8..b75538754 100644
--- a/modules/xmlrpc_main.cpp
+++ b/modules/xmlrpc_main.cpp
@@ -226,7 +226,7 @@ private:
request.reply("ip", u->ip.addr());
request.reply("timestamp", Anope::ToString(u->timestamp));
request.reply("signon", Anope::ToString(u->signon));
- if (u->Account())
+ if (u->IsIdentified())
{
request.reply("account", iface->Sanitize(u->Account()->display));
if (u->Account()->o)
diff --git a/src/language.cpp b/src/language.cpp
index 4ff190b35..bcade6ff1 100644
--- a/src/language.cpp
+++ b/src/language.cpp
@@ -62,7 +62,7 @@ const char *Language::Translate(const char *string)
const char *Language::Translate(User *u, const char *string)
{
- if (u && u->Account())
+ if (u && u->IsIdentified())
return Translate(u->Account(), string);
else
return Translate("", string);
diff --git a/src/memos.cpp b/src/memos.cpp
index 3aaded57d..e8b58df85 100644
--- a/src/memos.cpp
+++ b/src/memos.cpp
@@ -115,7 +115,7 @@ bool MemoInfo::HasIgnore(User *u)
{
for (const auto &ignore : this->ignores)
{
- if (u->nick.equals_ci(ignore) || (u->Account() && u->Account()->display.equals_ci(ignore)) || Anope::Match(u->GetMask(), Anope::string(ignore)))
+ if (u->nick.equals_ci(ignore) || (u->IsIdentified() && u->Account()->display.equals_ci(ignore)) || Anope::Match(u->GetMask(), Anope::string(ignore)))
return true;
}
return false;