1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd: (C) 2002-2009 InspIRCd Development Team
6 * See: http://wiki.inspircd.org/Credits
8 * This program is free but copyrighted software; see
9 * the file COPYING for details.
11 * ---------------------------------------------------
15 #include "configreader.h"
20 #include "modes/cmode_h.h"
22 ModeChannelHalfOp::ModeChannelHalfOp() : ModeHandler(NULL, "halfop", 'h', PARAM_ALWAYS, MODETYPE_CHANNEL)
26 levelrequired = OP_VALUE;
27 m_paramtype = TR_NICK;
30 unsigned int ModeChannelHalfOp::GetPrefixRank()
35 void ModeChannelHalfOp::RemoveMode(Channel* channel, irc::modestacker* stack)
37 const UserMembList* clist = channel->GetUsers();
39 for (UserMembCIter i = clist->begin(); i != clist->end(); i++)
43 stack->Push(this->GetModeChar(), i->first->nick);
47 std::vector<std::string> parameters;
48 parameters.push_back(channel->name);
49 parameters.push_back("-h");
50 parameters.push_back(i->first->nick);
51 ServerInstance->SendMode(parameters, ServerInstance->FakeClient);
57 void ModeChannelHalfOp::RemoveMode(User*, irc::modestacker* stack)
61 ModeAction ModeChannelHalfOp::OnModeChange(User* source, User*, Channel* channel, std::string ¶meter, bool adding)
63 return MODEACTION_ALLOW;