1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd: (C) 2002-2008 InspIRCd Development Team
6 * See: http://www.inspircd.org/wiki/index.php/Credits
8 * This program is free but copyrighted software; see
9 * the file COPYING for details.
11 * ---------------------------------------------------
18 #include "modes/umode_o.h"
20 ModeUserOperator::ModeUserOperator(InspIRCd* Instance) : ModeHandler(Instance, 'o', 0, 0, false, MODETYPE_USER, true)
24 ModeAction ModeUserOperator::OnModeChange(User* source, User* dest, Channel*, std::string&, bool adding, bool servermode)
26 /* Only opers can execute this class at all */
27 if (!ServerInstance->ULine(source->nick.c_str()) &&
28 !ServerInstance->ULine(source->server) &&
30 return MODEACTION_DENY;
32 /* Not even opers can GIVE the +o mode, only take it away */
34 return MODEACTION_DENY;
37 * Note that oper status is only given in cmd_oper.cpp
38 * NOT here. It is impossible to directly set +o without
39 * verifying as an oper and getting an opertype assigned
43 ServerInstance->SNO->WriteToSnoMask('o', "User %s de-opered (by %s)", dest->nick.c_str(), source->nick.c_str());
45 ServerInstance->SNO->WriteToSnoMask('O', "User %s de-opered (by %s)", dest->nick.c_str(), source->nick.c_str());
48 return MODEACTION_ALLOW;
51 unsigned int ModeUserOperator::GetCount()