diff options
author | Sadie Powell <sadie@witchery.services> | 2024-09-26 12:47:29 +0100 |
---|---|---|
committer | Sadie Powell <sadie@witchery.services> | 2024-09-26 12:51:54 +0100 |
commit | 5a0c6b1f18668c8541412e0ae38d53e3cdc68f01 (patch) | |
tree | 922f8538c33b9ec5f4c4f2b9bdd9fa9fb7aa767a | |
parent | ade8db023eca7575ad16096ecf5bb2ba38483a95 (diff) |
Fix setting +o on opers on login.
-rw-r--r-- | src/users.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/users.cpp b/src/users.cpp index 9b370ea06..da4772727 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -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()) { |