-
- if(operhost.size())
- Srv->ChangeHost(user, operhost);
-
- strlcpy(user->oper, type.c_str(), NICKMAX-1);
-
- WriteOpers("*** %s (%s@%s) is now an IRC operator of type %s", user->nick, user->ident, user->host, type.c_str());
- WriteServ(user->fd,"381 %s :You are now an IRC operator of type %s", user->nick, type.c_str());
-
- if(!user->modes[UM_OPERATOR])
- {
- user->modes[UM_OPERATOR] = 1;
- WriteServ(user->fd,"MODE %s :+o",user->nick);
- FOREACH_MOD(I_OnOper,OnOper(user, type));
- AddOper(user);
- FOREACH_MOD(I_OnPostOper,OnPostOper(user, type));
- log(DEFAULT,"OPER: %s!%s@%s opered as type: %s", user->nick, user->ident, user->host, type.c_str());
- }
-
+
+ if (operhost.size())
+ user->ChangeDisplayedHost(operhost.c_str());
+
+ ServerInstance->SNO->WriteToSnoMask('o',"%s (%s@%s) is now an IRC operator of type %s", user->nick, user->ident, user->host, type.c_str());
+ user->WriteServ("381 %s :You are now an IRC operator of type %s", user->nick, type.c_str());
+
+ if (!user->modes[UM_OPERATOR])
+ user->Oper(type);
+