X-Git-Url: https://git.hcoop.net/clinton/bobotpp.git/blobdiff_plain/7b3d2f2b2aaabf024715ff32050d8136ac98cb08..6530edbf15c57acffc224cdc864f0dd611d0fa3f:/source/DCCConnection.C diff --git a/source/DCCConnection.C b/source/DCCConnection.C index a708aaf..d5cd487 100644 --- a/source/DCCConnection.C +++ b/source/DCCConnection.C @@ -17,10 +17,14 @@ // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. #include +#include #include "Socket.H" #include "DCCParser.H" #include "DCCConnection.H" +#include "Person.H" +#include "BotInterp.H" +#include "Utils.H" DCCConnection::DCCConnection(Bot *b, String n, unsigned long address, int port) @@ -33,13 +37,26 @@ DCCConnection::connect() { if (!socket.connect()) return false; + +#ifdef USESCRIPTS + // run hooks/dcc/chat-begin + DCCPerson *tmp = new DCCPerson (this); + bot->botInterp->RunHooks (Hook::DCC_CHAT_BEGIN, + tmp->getAddress (), + scm_list_n (Utils:: + string2SCM (tmp->getAddress ()), + SCM_UNDEFINED)); + delete tmp; +#endif + + return true; } bool DCCConnection::handleInput() { - String line = socket.readLine(); + std::string line = socket.readLine(); lastSpoken = time(0);