]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - src/modes/umode_w.cpp
In the grand tradition of huge fucking commits:
[user/henk/code/inspircd.git] / src / modes / umode_w.cpp
1 /*       +------------------------------------+
2  *       | Inspire Internet Relay Chat Daemon |
3  *       +------------------------------------+
4  *
5  *  InspIRCd: (C) 2002-2007 InspIRCd Development Team
6  * See: http://www.inspircd.org/wiki/index.php/Credits
7  *
8  * This program is free but copyrighted software; see
9  *            the file COPYING for details.
10  *
11  * ---------------------------------------------------
12  */
13
14 #include "inspircd.h"
15 #include "mode.h"
16 #include "channels.h"
17 #include "users.h"
18 #include "modes/umode_w.h"
19
20 ModeUserWallops::ModeUserWallops(InspIRCd* Instance) : ModeHandler(Instance, 'w', 0, 0, false, MODETYPE_USER, false)
21 {
22 }
23
24 ModeAction ModeUserWallops::OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding)
25 {
26         /* Only opers can change other users modes */
27         if ((source != dest) && (!*source->oper))
28                 return MODEACTION_DENY;
29
30         /* Set the bitfields */
31         if (dest->modes[UM_WALLOPS] != adding)
32         {
33                 dest->modes[UM_WALLOPS] = adding;
34                 return MODEACTION_ALLOW;
35         }
36
37         /* Allow the change */
38         return MODEACTION_DENY;
39 }
40
41 unsigned int ModeUserWallops::GetCount()
42 {
43         return count;
44 }