[project @ 2002-08-06 20:48:44 by unknown_lamer]
[clinton/bobotpp.git] / source / ServerQueue.C
index e04fb0e..d63ac4f 100644 (file)
@@ -91,16 +91,12 @@ ServerQueue::sendCTCP(String to, String command,
                       String message)
 {
   sendPrivmsg(to, String("\001") + command + " " + message + "\001");
-  // hook stuff (only get action for now)
 
-  // I don't think it is useful to generate messages for other types
-  // of CTCP stuff.
-  puts (command);
 #ifdef USESCRIPTS
   if (command == "ACTION")
     {
-      Interp::bot->botInterp->RunHooks (Hook::ACTION,
-                                       MNICK+ " " + to +
+      Interp::bot->botInterp->RunHooks (Hook::SEND_ACTION,
+                                       MNICK + " " + to +
                                        " " + message,
                                        scm_listify (Utils::
                                                  string2SCM (MNICK),
@@ -110,6 +106,20 @@ ServerQueue::sendCTCP(String to, String command,
                                                  string2SCM (message),
                                                  SCM_UNDEFINED));
     }
+  else
+    Interp::bot->botInterp->RunHooks (Hook::SEND_CTCP,
+                                  MNICK + " " + to + " " +
+                                  command + " " + message,
+                                  scm_listify (Utils::
+                                             string2SCM (MNICK),
+                                             Utils::
+                                             string2SCM (to),
+                                             Utils::
+                                             string2SCM
+                                             (command),
+                                             Utils::
+                                             string2SCM (message),
+                                               SCM_UNDEFINED));
 #endif
 
 }
@@ -212,7 +222,7 @@ ServerQueue::sendPrivmsg(String dest, String message)
 #ifdef USESCRIPTS
   if (message[0] != '\001')
     if (Utils::isChannel (dest))
-      Interp::bot->botInterp->RunHooks (Hook::PUBLIC,
+      Interp::bot->botInterp->RunHooks (Hook::SEND_PUBLIC,
                                        Interp::bot->nickName + " " + dest +
                                        " " + message,
                                        scm_listify (Utils::
@@ -223,7 +233,7 @@ ServerQueue::sendPrivmsg(String dest, String message)
                                                     string2SCM
                                                     (message), SCM_UNDEFINED));
     else
-      Interp::bot->botInterp->RunHooks (Hook::MESSAGE,
+      Interp::bot->botInterp->RunHooks (Hook::SEND_MESSAGE,
                                        Interp::bot->nickName + " " +
                                        message,
                                        scm_listify (Utils::