diff options
Diffstat (limited to 'src/users.cpp')
-rw-r--r-- | src/users.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/users.cpp b/src/users.cpp index 3b874c0f2..81fd13a33 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -537,8 +537,28 @@ void User::SetModeInternal(const MessageSource &source, UserMode *um, const Anop this->modes[um->name] = param; if (um->name == "OPER") + { ++OperCount; + if (this->IsServicesOper()) + { + if (!this->nc->o->ot->modes.empty()) + { + this->SetModes(NULL, "%s", this->nc->o->ot->modes.c_str()); + this->SendMessage(Me, "Changing your usermodes to \002%s\002", this->nc->o->ot->modes.c_str()); + UserMode *oper = ModeManager::FindUserModeByName("OPER"); + if (oper && !this->HasMode("OPER") && this->nc->o->ot->modes.find(oper->mchar) != Anope::string::npos) + IRCD->SendOper(this); + } + if (IRCD->CanSetVHost && !this->nc->o->vhost.empty()) + { + this->SendMessage(Me, "Changing your vhost to \002%s\002", this->nc->o->vhost.c_str()); + this->SetDisplayedHost(this->nc->o->vhost); + IRCD->SendVhost(this, "", this->nc->o->vhost); + } + } + } + if (um->name == "CLOAK" || um->name == "VHOST") this->UpdateHost(); |