- /* found this oper's opertype */
- Srv->Log(DEBUG,"Host and type match: "+TypeName+" "+type);
-
- std::string HostName = Conf.ReadValue("type","host",j);
-
- if(HostName.size())
- Srv->ChangeHost(user, HostName);
-
- 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());
- }
-
+ /* Opertype and host match, looks like this is it. */
+ std::string operhost = Conf.ReadValue("type", "host", j);
+
+ 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 %s %s",user->nick, strchr("aeiouAEIOU", type[0]) ? "an" : "a", irc::Spacify(type.c_str()));
+
+ if (!user->modes[UM_OPERATOR])
+ user->Oper(type, tname);
+