IRC SERVER
The goal of this project is to make you write your own IRC server.
UserLimit.hpp
Go to the documentation of this file.
1 #ifndef USER_LIMIT_H
2 #define USER_LIMIT_H
3 
4 // Our includes
5 #include "../Mode.hpp"
6 
7 class UserLimit : public ChannelModeType
8 {
9  public:
11  {
13  }
14 
15  bool validate(void)
16  {
17  if (_params.size() < 2)
18  {
20  return false;
21  }
22  return true;
23  }
24 
25  void add()
26  {
27  _channel->setUserLimit(atoll(_params[2].c_str()));
29  }
30 
31  void remove()
32  {
35  }
36 };
37 #endif
UserLimit::add
void add()
Definition: UserLimit.hpp:25
ChannelModeType::_sender
Client * _sender
Definition: Mode.hpp:21
UserLimit::UserLimit
UserLimit()
Definition: UserLimit.hpp:10
ChannelModeType::_mode
ChannelMode _mode
Definition: Mode.hpp:16
Client::message
void message(char const *message)
Definition: client.cpp:15
Channel::removeMode
void removeMode(ChannelMode mode)
Definition: Channel.hpp:349
ChannelModeType::_params
std::map< size_t, std::string > _params
Definition: Mode.hpp:20
ChannelModeType
Definition: Mode.hpp:13
UserLimit
Definition: UserLimit.hpp:7
ERR_NEEDMOREPARAMS
#define ERR_NEEDMOREPARAMS(servername, nick, command)
Definition: Replies.hpp:131
MAX_CLIENTS_PER_CHANNEL
#define MAX_CLIENTS_PER_CHANNEL
Definition: config.hpp:10
Channel::setUserLimit
void setUserLimit(size_t limit)
Definition: Channel.hpp:168
UserLimit::remove
void remove()
Definition: UserLimit.hpp:31
UserLimit::validate
bool validate(void)
Definition: UserLimit.hpp:15
ChannelModeType::_channel
Channel * _channel
Definition: Mode.hpp:19
CHANNEL_MODE_USER_LIMIT
@ CHANNEL_MODE_USER_LIMIT
Definition: Channel.hpp:16
Client::_nick
std::string _nick
Definition: Client.hpp:26
Client::_servername
std::string _servername
Definition: Client.hpp:30
Channel::addMode
void addMode(ChannelMode mode)
Definition: Channel.hpp:343