This repository was archived by the owner on Aug 3, 2025. It is now read-only.
forked from Jaapet/ft_irc
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSession.cpp
More file actions
68 lines (54 loc) · 1.29 KB
/
Copy pathSession.cpp
File metadata and controls
68 lines (54 loc) · 1.29 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#include "Session.hpp"
#include "reply.hpp"
Session::Session(Server const *server_ptr): _server(server_ptr), _username("*"), _nickname("*"), _realname("*")
{
this->_authenticated = false;
this->_pass_is_set = false;
this->_nick_is_set = false;
this->_realname_is_set = false;
this->_user_is_set = false;
this->_sendBuffer.clear();
this->_lastpong = 0;
this->_channel = NULL;
this->_away_status = "";
}
Session::~Session()
{
}
bool Session::authenticate(void)
{
if(this->_nick_is_set && this->_user_is_set && this->_realname_is_set)
{
this->_authenticated = true;
return(true);
}
return(false);
}
// int Session::join_chan(Channel &chan, std::string &pass)
// {
// return (chan.add_user(this->_nickname));
// }
// bool Session::quit_chan(Channel &chan)
// {
// return (chan.rm_user(this->_nickname));
// }
// void Session::set_topic(Channel &chan, std::string &topic)
// {
// chan.set_topic(topic);
// }
// std::string Session::get_topic(Channel &chan)
// {
// return (chan.get_topic());
// }
// std::vector<std::string> Session::names_chan(Channel &chan)
// {
// return (chan.get_users());
// }
// void Session::get_invited(Channel &chan)
// {
// chan.invite_user(this->_nickname);
// }
// void Session::invite(Session &user, Channel &chan)
// {
// user.get_invited(chan);
// }