]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - src/modes/cmode_t.cpp
Wakey wakey w00t :p
[user/henk/code/inspircd.git] / src / modes / cmode_t.cpp
1 /*       +------------------------------------+
2  *       | Inspire Internet Relay Chat Daemon |
3  *       +------------------------------------+
4  *
5  *  InspIRCd: (C) 2002-2008 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/cmode_t.h"
19
20 ModeChannelTopicOps::ModeChannelTopicOps(InspIRCd* Instance) : ModeHandler(Instance, 't', 0, 0, false, MODETYPE_CHANNEL, false)
21 {
22 }
23
24 ModeAction ModeChannelTopicOps::OnModeChange(User*, User*, Channel* channel, std::string&, bool adding, bool servermode)
25 {
26         if (channel->modes[CM_TOPICLOCK] != adding)
27         {
28                 channel->modes[CM_TOPICLOCK] = adding;
29                 return MODEACTION_ALLOW;
30         }
31         else
32         {
33                 return MODEACTION_DENY;
34         }
35 }
36