1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd: (C) 2002-2007 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_i.h"
20 ModeUserInvisible::ModeUserInvisible(InspIRCd* Instance) : ModeHandler(Instance, 'i', 0, 0, false, MODETYPE_USER, false)
24 ModeAction ModeUserInvisible::OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string ¶meter, bool adding)
26 /* Only opers can change other users modes */
27 if ((source != dest) && (!*source->oper))
28 return MODEACTION_DENY;
30 /* Set the bitfields */
31 if (dest->modes[UM_INVISIBLE] != adding)
33 dest->modes[UM_INVISIBLE] = adding;
34 this->count += (adding ? 1: -1);
35 return MODEACTION_ALLOW;
38 /* Allow the change */
39 return MODEACTION_DENY;
42 unsigned int ModeUserInvisible::GetCount()