1
0
mirror of https://github.com/anope/anope.git synced 2026-06-27 20:26:38 +02:00

Fix setting +o on opers on login.

This commit is contained in:
Sadie Powell
2024-09-26 12:47:29 +01:00
parent ade8db023e
commit 5a0c6b1f18
+8 -6
View File
@@ -378,11 +378,12 @@ void User::Identify(NickAlias *na)
{
if (!this->nc->o->ot->modes.empty())
{
this->SetModes(NULL, this->nc->o->ot->modes);
this->SendMessage(NULL, "Changing your usermodes to \002%s\002", this->nc->o->ot->modes.c_str());
UserMode *um = ModeManager::FindUserModeByName("OPER");
auto *um = ModeManager::FindUserModeByName("OPER");
if (um && !this->HasMode("OPER") && this->nc->o->ot->modes.find(um->mchar) != Anope::string::npos)
IRCD->SendOper(this);
this->SetModes(NULL, this->nc->o->ot->modes);
this->SendMessage(NULL, "Changing your usermodes to \002%s\002", this->nc->o->ot->modes.c_str());
}
if (IRCD->CanSetVHost && !this->nc->o->vhost.empty())
{
@@ -548,11 +549,12 @@ void User::SetModeInternal(const MessageSource &source, UserMode *um, const Anop
{
if (!this->nc->o->ot->modes.empty())
{
this->SetModes(NULL, this->nc->o->ot->modes);
this->SendMessage(NULL, "Changing your usermodes to \002%s\002", this->nc->o->ot->modes.c_str());
UserMode *oper = ModeManager::FindUserModeByName("OPER");
auto *oper = ModeManager::FindUserModeByName("OPER");
if (oper && !this->HasMode("OPER") && this->nc->o->ot->modes.find(oper->mchar) != Anope::string::npos)
IRCD->SendOper(this);
this->SetModes(NULL, this->nc->o->ot->modes);
this->SendMessage(NULL, "Changing your usermodes to \002%s\002", this->nc->o->ot->modes.c_str());
}
if (IRCD->CanSetVHost && !this->nc->o->vhost.empty())
{