]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - src/coremods/core_channel/core_channel.h
Rewrite invite system
[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 namespace Invite
30 {
31         class APIImpl;
32 }
33
34 /** Handle /INVITE.
35  */
36 class CommandInvite : public Command
37 {
38         Invite::APIImpl& invapi;
39
40  public:
41         /** Constructor for invite.
42          */
43         CommandInvite(Module* parent, Invite::APIImpl& invapiimpl);
44
45         /** Handle command.
46          * @param parameters The parameters to the command
47          * @param user The user issuing the command
48          * @return A value from CmdResult to indicate command success or failure.
49          */
50         CmdResult Handle(const std::vector<std::string>& parameters, User*user);
51         RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters);
52 };
53
54 /** Handle /JOIN.
55  */
56 class CommandJoin : public SplitCommand
57 {
58  public:
59         /** Constructor for join.
60          */
61         CommandJoin(Module* parent);
62
63         /** Handle command.
64          * @param parameters The parameters to the command
65          * @param user The user issuing the command
66          * @return A value from CmdResult to indicate command success or failure.
67          */
68         CmdResult HandleLocal(const std::vector<std::string>& parameters, LocalUser* user);
69 };
70
71 /** Handle /TOPIC.
72  */
73 class CommandTopic : public SplitCommand
74 {
75         ChanModeReference secretmode;
76         ChanModeReference topiclockmode;
77
78  public:
79         /** Constructor for topic.
80          */
81         CommandTopic(Module* parent);
82
83         /** Handle command.
84          * @param parameters The parameters to the command
85          * @param user The user issuing the command
86          * @return A value from CmdResult to indicate command success or failure.
87          */
88         CmdResult HandleLocal(const std::vector<std::string>& parameters, LocalUser* user);
89 };
90
91 /** Handle /NAMES.
92  */
93 class CommandNames : public Command
94 {
95         ChanModeReference secretmode;
96         ChanModeReference privatemode;
97         UserModeReference invisiblemode;
98
99  public:
100         /** Constructor for names.
101          */
102         CommandNames(Module* parent);
103
104         /** Handle command.
105          * @param parameters The parameters to the command
106          * @param user The user issuing the command
107          * @return A value from CmdResult to indicate command success or failure.
108          */
109         CmdResult Handle(const std::vector<std::string>& parameters, User *user);
110
111         /** Spool the NAMES list for a given channel to the given user
112          * @param user User to spool the NAMES list to
113          * @param chan Channel whose nicklist to send
114          * @param show_invisible True to show invisible (+i) members to the user, false to omit them from the list
115          */
116         void SendNames(User* user, Channel* chan, bool show_invisible);
117 };
118
119 /** Handle /KICK.
120  */
121 class CommandKick : public Command
122 {
123  public:
124         /** Constructor for kick.
125          */
126         CommandKick(Module* parent);
127
128         /** Handle command.
129          * @param parameters The parameters to the command
130          * @param user The user issuing the command
131          * @return A value from CmdResult to indicate command success or failure.
132          */
133         CmdResult Handle(const std::vector<std::string>& parameters, User *user);
134         RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters);
135 };