-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheck_command.cpp
More file actions
44 lines (43 loc) · 1.46 KB
/
check_command.cpp
File metadata and controls
44 lines (43 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#include "Server.hpp"
void Server::check_command(msg_parse &command, User &user)
{
if (command.get_cmd() == "NICK" || command.get_cmd() == "USER" || command.get_cmd() == "PASS")
{
user_authentication(command, user);
}
else if (user.is_real_user())
{
if (command.get_cmd() == "MODE")
MODE_handler(command, user);
else if (command.get_cmd() == "AWAY")
AWAY_handler(command, user);
else if (command.get_cmd() == "LUSERS")
LUSERS_handler(command, user);
else if (command.get_cmd() == "MOTD")
MOTD_handler(command, user);
else if (command.get_cmd() == "NAMES")
NAMES_handler(command, user);
else if (command.get_cmd() == "LIST")
LIST_handler(command, user);
else if (command.get_cmd() == "PRIVMSG" || command.get_cmd() == "NOTICE")
PRIVMSG_handler(command, user);
else if (command.get_cmd() == "QUIT")
QUIT_handler(user, command);
else if (command.get_cmd() == "OPER")
OPER_handler(user, command);
else if (command.get_cmd() == "TOPIC")
TOPIC_handler(user, command);
else if (command.get_cmd() == "JOIN")
JOIN_handler(user, command);
else if (command.get_cmd() == "PART")
PART_handler(user, command);
else if (command.get_cmd() == "INVITE")
INVITE_handler(user, command);
else if (command.get_cmd() == "KICK")
KICK_handler(user, command);
else if (command.get_cmd() != "PONG")
write_reply(user, ERR_UNKNOWNCOMMAND, command);
}
else
write_reply(user, ERR_NOTREGISTERED, command);
}