comparison sources/connection.cpp @ 5:0faceb076254

code clean up added PID to the default Core argument bool => true|false
author Vlad Glagolev <enqlave@gmail.com>
date Thu, 24 Jan 2008 21:00:52 +0300
parents a7051ac7118b
children 9be05a31b7f9
comparison
equal deleted inserted replaced
4:a7051ac7118b 5:0faceb076254
43 } 43 }
44 44
45 void Connection::ircConnect() 45 void Connection::ircConnect()
46 { 46 {
47 if (!current) 47 if (!current)
48 shut ("no hosts defined"); 48 shut("no hosts defined");
49 49
50 if (!connected && !connecting) { 50 if (!connected && !connecting) {
51 cout << "CONNECTION: connecting to server: " << current->host << endl; 51 cout << "CONNECTION: connecting to server: " << current->host << endl;
52 52
53 if (!resolveHost(current->host, &address)) { 53 if (!resolveHost(current->host, &address)) {
115 void Connection::ircAway(string away) 115 void Connection::ircAway(string away)
116 { 116 {
117 sendMsg("AWAY :" + away); 117 sendMsg("AWAY :" + away);
118 } 118 }
119 119
120 void Connection::ircJoin(string nchan, string nckey) 120 void Connection::ircJoin(string chan, string key)
121 { 121 {
122 sendMsg("JOIN " + nchan + (nckey != "" ? " " + nckey : "")); 122 sendMsg("JOIN " + chan + (key != "" ? " " + key : ""));
123 } 123 }
124 124
125 void Connection::ircPart(string nchan) 125 void Connection::ircPart(string chan)
126 { 126 {
127 sendMsg("PART " + nchan); 127 sendMsg("PART " + chan);
128 } 128 }
129 129
130 void Connection::ircCycle(string nchan) 130 void Connection::ircCycle(string chan)
131 { 131 {
132 sendMsg("PART " + nchan); 132 sendMsg("PART " + chan);
133 sendMsg("JOIN " + nchan); 133 sendMsg("JOIN " + chan);
134 } 134 }
135 135
136 Connection::host_type * 136 Connection::host_type *Connection::addHost(host_type *list, pchar host, \
137 Connection::addHost(host_type *list, pchar host, int port, pchar password) 137 int port, pchar password)
138 { 138 {
139 if (!list) 139 if (!list)
140 current = list = new host_type(host, port, password); 140 current = list = new host_type(host, port, password);
141 else if (list->next == current) 141 else if (list->next == current)
142 list->next = new host_type(host, port, password, current); 142 list->next = new host_type(host, port, password, current);