]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - src/coremods/core_channel/core_channel.h
755f876f6dd73953acdef6fcb22057817c7fd0c4
[user/henk/code/inspircd.git] / src / coremods / core_channel / core_channel.h
1 /*
2  * InspIRCd -- Internet Relay Chat Daemon
3  *
4  *   Copyright (C) 2014 Attila Molnar <attilamolnar@hush.com>
5  *
6  * This file is part of InspIRCd.  InspIRCd is free software: you can
7  * redistribute it and/or modify it under the terms of the GNU General Public
8  * License as published by the Free Software Foundation, version 2.
9  *
10  * This program is distributed in the hope that it will be useful, but WITHOUT
11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12  * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
13  * details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
17  */
18
19
20 #pragma once
21
22 #include "inspircd.h"
23
24 namespace Topic
25 {
26         void ShowTopic(LocalUser* user, Channel* chan);
27 }
28
29 /** Handle /INVITE.
30  */
31 class CommandInvite : public Command
32 {
33  public:
34         /** Constructor for invite.
35          */
36         CommandInvite (Module* parent);
37
38         /** Handle command.
39          * @param parameters The parameters to the command
40          * @param user The user issuing the command
41          * @return A value from CmdResult to indicate command success or failure.
42          */
43         CmdResult Handle(const std::vector<std::string>& parameters, User*user);
44         RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters);
45 };
46
47 /** Handle /JOIN.
48  */
49 class CommandJoin : public SplitCommand
50 {
51  public:
52         /** Constructor for join.
53          */
54         CommandJoin(Module* parent);
55
56         /** Handle command.
57          * @param parameters The parameters to the command
58          * @param user The user issuing the command
59          * @return A value from CmdResult to indicate command success or failure.
60          */
61         CmdResult HandleLocal(const std::vector<std::string>& parameters, LocalUser* user);
62 };
63
64 /** Handle /TOPIC.
65  */
66 class CommandTopic : public SplitCommand
67 {
68         ChanModeReference secretmode;
69         ChanModeReference topiclockmode;
70
71  public:
72         /** Constructor for topic.
73          */
74         CommandTopic(Module* parent);
75
76         /** Handle command.
77          * @param parameters The parameters to the command
78          * @param user The user issuing the command
79          * @return A value from CmdResult to indicate command success or failure.
80          */
81         CmdResult HandleLocal(const std::vector<std::string>& parameters, LocalUser* user);
82 };
83
84 /** Handle /NAMES.
85  */
86 class CommandNames : public Command
87 {
88         ChanModeReference secretmode;
89         ChanModeReference privatemode;
90         UserModeReference invisiblemode;
91
92  public:
93         /** Constructor for names.
94          */
95         CommandNames(Module* parent);
96
97         /** Handle command.
98          * @param parameters The parameters to the command
99          * @param user The user issuing the command
100          * @return A value from CmdResult to indicate command success or failure.
101          */
102         CmdResult Handle(const std::vector<std::string>& parameters, User *user);
103
104         /** Spool the NAMES list for a given channel to the given user
105          * @param user User to spool the NAMES list to
106          * @param chan Channel whose nicklist to send
107          * @param show_invisible True to show invisible (+i) members to the user, false to omit them from the list
108          */
109         void SendNames(User* user, Channel* chan, bool show_invisible);
110 };
111
112 /** Handle /KICK.
113  */
114 class CommandKick : public Command
115 {
116  public:
117         /** Constructor for kick.
118          */
119         CommandKick(Module* parent);
120
121         /** Handle command.
122          * @param parameters The parameters to the command
123          * @param user The user issuing the command
124          * @return A value from CmdResult to indicate command success or failure.
125          */
126         CmdResult Handle(const std::vector<std::string>& parameters, User *user);
127         RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters);
128 };