Factor out sorted list insertion into utility function
[clinton/bobotpp.git] / source / DCCConnection.C
1 // DCCConnection.C -*- C++ -*-
2 // Copyright (c) 1998 Etienne BERNARD
3 // Copyright (C) 2002 Clinton Ebadi
4
5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation; either version 2 of the License, or
8 // any later version.
9
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18
19 #include <ctime>
20 #include <string>
21
22 #include "Socket.H"
23 #include "DCCParser.H"
24 #include "DCCConnection.H"
25 #include "Person.H"
26 #include "BotInterp.H"
27 #include "Utils.H"
28
29 DCCConnection::DCCConnection(unsigned long address,
30 int port)
31 : Connection(address, port)
32 { }
33
34 DCCConnection::DCCConnection(Bot *b, String n, unsigned long address,
35 int port)
36 : Connection(address, port), bot(b), nuh (n), lastSpoken(time(0)), autoRemove(true)
37 { }
38
39 // bool
40 // DCCConnection::connect()
41 // {
42 // if (!socket.connect())
43 // return false;
44
45 // #ifdef USESCRIPTS
46 // // run hooks/dcc/chat-begin
47 // DCCPerson *tmp = new DCCPerson (this);
48 // bot->botInterp->RunHooks (Hook::DCC_CHAT_BEGIN,
49 // tmp->getAddress (),
50 // scm_list_n (Utils::
51 // string2SCM (tmp->getAddress ()),
52 // SCM_UNDEFINED));
53 // delete tmp;
54 // #endif
55
56
57 // return true;
58 // }
59
60 // bool
61 // DCCConnection::handleInput()
62 // {
63 // std::string line = socket.readLine();
64
65 // lastSpoken = time(0);
66
67 // if (line.length() == 0)
68 // return true;
69
70 // if (bot->debug)
71 // std::cout << "DCC: <" << line << ">" << std::endl;
72
73 // DCCParser::parseLine(this, line);
74
75 // return false;
76 // }
77
78 // void
79 // DCCConnection::sendNotice(String message)
80 // {
81 // socket.write(message, true);
82 // }