[project @ 2005-07-06 19:32:18 by unknown_lamer]
[clinton/bobotpp.git] / source / ScriptCommands.C
index 837e5b5..84049f5 100644 (file)
@@ -158,7 +158,8 @@ ScriptCommands::ChangeCommandLevel(SCM command, SCM level)
 
   SCM_STRING_COERCE_0TERMINATION_X (command);
   std::string ccommand = SCM_STRING_CHARS (command);
-  unsigned int llevel = scm_num2uint (level, 0, "ScriptCommands::ChangeCommandLevel");
+  unsigned int llevel = scm_num2uint 
+    (level, 0, "ScriptCommands::ChangeCommandLevel");
 
   if (llevel > 4)
     return SCM_BOOL_F;
@@ -177,6 +178,34 @@ ScriptCommands::ChangeCommandLevel(SCM command, SCM level)
   return SCM_BOOL_T;
 }
 
+SCM
+ScriptCommands::CTCP(SCM to, SCM command , SCM message)
+{
+  VERIFY_STRING(to);
+  VERIFY_STRING(command);
+  VERIFY_STRING(message);
+
+  Commands::CTCP (Interp::bot, Utils::scm2str (to), 
+                     Utils::scm2str (command),
+                     Utils::scm2str (message));
+
+  return SCM_UNSPECIFIED;
+}
+
+SCM
+ScriptCommands::CTCPReply (SCM to, SCM command , SCM message)
+{
+  VERIFY_STRING(to);
+  VERIFY_STRING(command);
+  VERIFY_STRING(message);
+
+  Commands::CTCPReply (Interp::bot, Utils::scm2str (to), 
+                      Utils::scm2str (command),
+                      Utils::scm2str (message));
+
+  return SCM_UNSPECIFIED;
+}
+
 SCM
 ScriptCommands::Cycle(SCM channel)
 {
@@ -479,6 +508,26 @@ ScriptCommands::Unlock(SCM channel)
   return scm_long2num(m.getCode());
 }
 
+SCM
+ScriptCommands::Who (SCM target)
+{
+  VERIFY_STRING (target);
+
+  Message m = Commands::Who (Interp::bot, Utils::scm2str (target));
+
+  return scm_long2num (m.getCode ());
+}
+
+SCM
+ScriptCommands::Whois (SCM nick)
+{
+  VERIFY_STRING (nick);
+
+  Message m = Commands::Whois (Interp::bot, Utils::scm2str (nick));
+
+  return scm_long2num (m.getCode ());
+}
+
 SCM
 ScriptCommands::getNickname(void)
 {
@@ -649,38 +698,9 @@ ScriptCommands::sendDCCChatMessage (SCM to, SCM message)
                    Utils::scm2str (message)));
 }
 
-// Message sending
-// FIXME: write these
-
-#define IQUEUE Interp::bot->serverConnection->queue
 
-SCM
-ScriptCommands::sendCTCP(SCM to, SCM command , SCM message)
-{
-  VERIFY_STRING(to);
-  VERIFY_STRING(command);
-  VERIFY_STRING(message);
 
-  Commands::CTCP (Interp::bot, Utils::scm2str (to), 
-                     Utils::scm2str (command),
-                     Utils::scm2str (message));
 
-  return SCM_UNSPECIFIED;
-}
-
-SCM
-ScriptCommands::sendCTCPReply (SCM to, SCM command , SCM message)
-{
-  VERIFY_STRING(to);
-  VERIFY_STRING(command);
-  VERIFY_STRING(message);
-
-  Commands::CTCPReply (Interp::bot, Utils::scm2str (to), 
-                      Utils::scm2str (command),
-                      Utils::scm2str (message));
-
-  return SCM_UNSPECIFIED;
-}
 
 
 #endif