[project @ 2005-06-28 09:54:46 by unknown_lamer]
[clinton/bobotpp.git] / source / DCCParser.C
1 // DCCParser.C -*- C++ -*-
2 // Copyright (c) 1998 Etienne BERNARD
3 // Copyright (C) 2002,2005 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 #ifdef HAVE_CONFIG_H
20 #include "config.h"
21 #endif
22
23 #include "DCCParser.H"
24 #include "DCCPerson.H"
25 #include "Parser.H"
26 #include "BotInterp.H"
27 #include "Utils.H"
28
29 void
30 DCCParser::parseLine(DCCConnection *cnx, String line)
31 {
32 Person * from = new DCCPerson(cnx);
33 #ifdef USESCRIPTS
34 // Call hooks/dcc/chat-message hook functions
35 cnx->get_bot()->botInterp->RunHooks (Hook::DCC_CHAT_MESSAGE,
36 from->getAddress () + " " + line,
37 scm_list_n (Utils::str2scm (from->getAddress ()),
38 Utils::str2scm (line),
39 SCM_UNDEFINED));
40 #endif
41 Parser::parseMessage(cnx->get_bot()->serverConnection,
42 from, cnx->get_bot()->nickName,
43 line);
44 delete from;
45 }