1
0
mirror of https://github.com/anope/anope.git synced 2026-07-06 10:33:12 +02:00

Merge branch '2.0' into 2.1.

This commit is contained in:
Sadie Powell
2024-11-11 17:10:24 +00:00
16 changed files with 21 additions and 21 deletions
+3 -3
View File
@@ -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);";
+1 -1
View File
@@ -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();
+1 -1
View File
@@ -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)
+1 -1
View File
@@ -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());
+2 -2
View File
@@ -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);
}
+1 -1
View File
@@ -145,7 +145,7 @@ public:
{
User *u = User::Find(uid);
if (!u || !u->Account() || r.empty())
if (!u || !u->IsIdentified() || r.empty())
return;
try
+1 -1
View File
@@ -24,7 +24,7 @@ public:
void OnResult(const LDAPResult &r) override
{
if (!u || !u->Account())
if (!u || !u->IsIdentified())
return;
NickCore *nc = u->Account();
+1 -1
View File
@@ -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());
}
}
+1 -1
View File
@@ -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);
+1 -1
View File
@@ -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;
+3 -3
View File
@@ -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();
}
+1 -1
View File
@@ -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());
}
};
+1 -1
View File
@@ -48,7 +48,7 @@ public:
{
SQLOperResultDeleter d(this);
if (!user || !user->Account())
if (!user || !user->IsIdentified())
return;
if (r.Rows() == 0)
+1 -1
View File
@@ -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)
+1 -1
View File
@@ -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);
+1 -1
View File
@@ -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;