[project @ 2005-06-23 06:43:12 by unknown_lamer]
[clinton/bobotpp.git] / source / Bot.C
index 9c67822..741e2e1 100644 (file)
@@ -318,12 +318,25 @@ Bot::run()
 {
   nextServer();
 
-  while (!stop) {
-    waitForInput();  // This is the main event loop
-    dccConnections->checkStale ();
-    if (!serverConnection->queue->flush())
-      nextServer();
-  }
+  while (!stop) 
+    {
+      waitForInput();  // This is the main event loop
+      dccConnections->checkStale ();
+
+      if (!serverConnection->queue->flush())
+       {
+         // Disconnected
+#ifdef USESCRIPTS
+         // Run hooks/disconnected
+         this->botInterp->RunHooks 
+           (Hook::DISCONNECT, 
+            serverConnection->server->getHostName (),
+            scm_list_n 
+            (Utils::str2scm  (serverConnection->server->getHostName ())));
+#endif
+         nextServer();
+       }
+    }
 }
 
 void