diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/protocol.cpp | 6 | ||||
-rw-r--r-- | src/users.cpp | 3 |
2 files changed, 9 insertions, 0 deletions
diff --git a/src/protocol.cpp b/src/protocol.cpp index 14fe249ed..5d836b7f4 100644 --- a/src/protocol.cpp +++ b/src/protocol.cpp @@ -316,6 +316,12 @@ bool IRCDProto::IsChannelValid(const Anope::string &chan) return true; } +void IRCDProto::SendOper(User *u) +{ + SendNumericInternal(381, u->GetUID(), ":You are now an IRC operator (set by services)"); + u->SetMode(findbot(Config->OperServ), UMODE_OPER); +} + MessageSource::MessageSource(const Anope::string &src) : source(src), u(NULL), s(NULL) { if (src.empty()) diff --git a/src/users.cpp b/src/users.cpp index 603c22745..28b2c413c 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -431,6 +431,9 @@ void User::Identify(NickAlias *na) this->SetModes(bi, "%s", this->nc->o->ot->modes.c_str()); if (bi != NULL) this->SendMessage(bi, "Changing your usermodes to \002%s\002", this->nc->o->ot->modes.c_str()); + UserMode *um = ModeManager::FindUserModeByName(UMODE_OPER); + if (um && !this->HasMode(UMODE_OPER) && this->nc->o->ot->modes.find(um->ModeChar) != Anope::string::npos) + ircdproto->SendOper(this); } if (ircdproto->CanSetVHost && !this->nc->o->vhost.empty()) { |