// DCCManager.H -*- C++ -*-
-// Copyright (c) 2002 Clinton Ebadi
+// Copyright (c) 2002,2005 Clinton Ebadi
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+// 02110-1301, USA.
#include "DCCManager.H"
+#include "Utils.H"
void
DCCManager::addConnection (DCCConnection *cnx)
if (temp_cnx->get_autoRemove () && std::time (0) >=
(std::time_t)(temp_cnx->get_lastSpoken () + Bot::DCC_DELAY))
{
+#ifdef USESCRIPTS
+ DCCPerson *dp = new DCCPerson ((DCCConnection *) temp_cnx);
+
+ // run hooks/dcc/chat-end
+ dp->bot->botInterp->RunHooks
+ (Hook::DCC_CHAT_END,
+ dp->getAddress (),
+ scm_list_n (Utils::
+ str2scm (dp->getAddress ()),
+ SCM_UNDEFINED));
+ delete dp;
+#endif
delete it->second;
dcc_map.erase (it);
}
{
if (it2->second->handleInput())
{
+#ifdef USESCRIPTS
+ DCCPerson *dp = new DCCPerson (*it2->second);
+
+ // run hooks/dcc/chat-end
+ dp->bot->botInterp->RunHooks
+ (Hook::DCC_CHAT_END,
+ dp->getAddress (),
+ scm_list_n (Utils::
+ str2scm (dp->getAddress ()),
+ SCM_UNDEFINED));
+ delete dp;
+#endif
+
delete it2->second->dcc;
delete it2->second;
dcc_map.erase(it2);