IRC SERVER
The goal of this project is to make you write your own IRC server.
Key.hpp
Go to the documentation of this file.
1 #ifndef KEY_H
2 #define KEY_H
3 
4 // Our includes
5 #include "../Mode.hpp"
6 
7 class Key : public ChannelModeType
8 {
9  public:
10  Key()
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  {
29  }
30 
31  void remove()
32  {
33  _channel->setPassword("");
35  }
36 };
37 #endif
Key::Key
Key()
Definition: Key.hpp:10
Channel::setPassword
void setPassword(std::string passwd)
Definition: Channel.hpp:71
ChannelModeType::_sender
Client * _sender
Definition: Mode.hpp:21
ChannelModeType::_mode
ChannelMode _mode
Definition: Mode.hpp:16
Client::message
void message(char const *message)
Definition: client.cpp:15
CHANNEL_MODE_KEY
@ CHANNEL_MODE_KEY
Definition: Channel.hpp: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
Key::add
void add()
Definition: Key.hpp:25
ERR_NEEDMOREPARAMS
#define ERR_NEEDMOREPARAMS(servername, nick, command)
Definition: Replies.hpp:131
Key::validate
bool validate(void)
Definition: Key.hpp:15
ChannelModeType::_channel
Channel * _channel
Definition: Mode.hpp:19
Key
Definition: Key.hpp:7
Key::remove
void remove()
Definition: Key.hpp:31
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