[project @ 2005-07-05 07:24:59 by unknown_lamer]
[clinton/bobotpp.git] / source / Parser.C
index cbecfe7..1dd60cb 100644 (file)
@@ -14,7 +14,8 @@
 
 // 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., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+// 02110-1301, USA.
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #include "StringTokenizer.H"
 #include "Parser.H"
 #include "UserCommands.H"
+#include "Commands.H"
 #include "Macros.H"
 #include "Utils.H"
 #include "ShitList.H"
 
 typedef void (*fptr) (ServerConnection *, Person *, String);
-std::map < std::string, fptr, std::less < std::string > >Parser::functions;
+std::map < std::string, fptr, std::less < std::string > > Parser::functions;
 
 void
 Parser::init ()
@@ -427,9 +429,9 @@ Parser::parseJoin (ServerConnection * cnx, Person * from, String rest)
          && !(ch->getUser (n)->mode & User::OP_MODE) && cnx->bot->iAmOp (c))
        {
          // This is a part of the antispoof code
-         ch->getUser (n)->userkey = Utils::get_key ();
+         ch->getUser(n)->userkey = Utils::get_key ();
          Commands::CTCP (cnx->bot, n, "PING", 
-                         ch->getUser (n)->userkey + " " + c);
+                         ch->getUser(n)->userkey + " " + c);
        }
     }
 
@@ -712,7 +714,7 @@ Parser::parsePart (ServerConnection * cnx, Person * from, String rest)
   StringTokenizer st (rest);
   String channel = st.next_token ();
 #ifdef USESCRIPTS
-  cnx->bot->botInterp->RunHooks (Hook::LEAVE, n + " " + channel,
+  cnx->bot->botInterp->RunHooks (Hook::PART, n + " " + channel,
                                 scm_listify (Utils::
                                              str2scm (n),
                                              Utils::
@@ -721,7 +723,7 @@ Parser::parsePart (ServerConnection * cnx, Person * from, String rest)
 #endif
   if (n.toLower () == cnx->bot->nickName.toLower ())
     {
-      cnx->bot->logLine (String ("Leaved channel ") + channel + ".");
+      cnx->bot->logLine (String ("Left channel ") + channel + ".");
       cnx->bot->channelList->delChannel (channel);
     }
   else
@@ -1045,7 +1047,8 @@ Parser::parseScriptFunction (ServerConnection * cnx,
   wd.func = scmFunc;
   wd.args = args_list;
   scm_internal_catch (SCM_BOOL_T,
-                     (scm_t_catch_body) lazy_apply_wrapper, (void *) &wd,
-                     (scm_t_catch_handler) empty_handler, 0);
+                     (scm_t_catch_body) Interp::LazyApplyWrapper, 
+                     (void *) &wd,
+                     (scm_t_catch_handler) Interp::EmptyHandler, 0);
 }
 #endif