[project @ 2005-07-05 18:48:49 by unknown_lamer]
authorunknown_lamer <unknown>
Tue, 5 Jul 2005 18:48:50 +0000 (18:48 +0000)
committerunknown_lamer <unknown>
Tue, 5 Jul 2005 18:48:50 +0000 (18:48 +0000)
Renamed bot:send-ctcp and bot:send-ctcp-reply to bot:ctcp and bot:ctcp-reply

12 files changed:
ChangeLog
NEWS
bobot++.info
bobot++.texinfo
source/Commands.H
source/Interp.C
source/ScriptCommands.C
source/ScriptCommands.H
source/ServerQueue.C
source/ServerQueueItem.C
source/ServerQueueItem.H
source/UserCommands.H

index 5626433..6ef201d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2005-07-05  Clinton Ebadi  <clinton@unknownlamer.org>
+
+       * bobot++.texinfo (Low Level Message Functions): Updated docs to
+       reflect new names for ctcp functions
+
+       * source/Interp.C (interp_init_helper): Register
+       ScriptCommands::Notice instead of sendNotice
+       (interp_init_helper): Renamed bot:send-ctcp to bot:ctcp
+       (interp_init_helper): Renamed bot:send-ctcp-reply to bot:ctcp-reply
+
+       * source/ScriptCommands.C (Notice): Renamed from sentNotice
+
+       * source/ScriptCommands.H: Renamed sendNotice to Notice
+
+       * bobot++.texinfo (Hook Types): Spelling fix
+
 2005-07-04  Clinton Ebadi  <clinton@unknownlamer.org>
 
        * scripts/bobot-utils.scm (_deprecated-fun): Set
diff --git a/NEWS b/NEWS
index 492749c..c18a654 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -17,6 +17,8 @@ Version 2.1.9:
   + The deprecated scripting procedure and hook names are now in a
     `begin-deprecated' block. If your guile is built without
     deprecated feature support, they will not be available.
+  + RENAME: bot:send-ctcp was renamed to bot:ctcp
+  + RENAME: bot:send-ctcp-reply was renamed to bot:ctcp-reply
 - Documention
   + Reorganized a few sections
   + Every hook is now documented
index 7450cf6..d674325 100644 (file)
@@ -643,7 +643,7 @@ File: bobot++.info,  Node: Hook Types,  Prev: Creating a Hook,  Up: Hooks
 The following sections document the different hooks Bobot++ exposes.
 
    The general format of each hook description is as if it were a
-function to be defined, but these describe the function to be passwd to
+function to be defined, but these describe the function to be passed to
 `bot:add-hook'.  Do _not_ name your functions these names.
 
    That said, here is the list of available hooks functions.  FIXME:
index 38f5ec2..0b46fe5 100644 (file)
@@ -685,7 +685,7 @@ avoid a conflict with other hooks.
 The following sections document the different hooks Bobot++ exposes.
 
 The general format of each hook description is as if it were a
-function to be defined, but these describe the function to be passwd
+function to be defined, but these describe the function to be passed
 to @code{bot:add-hook}.  Do @emph{not} name your functions these
 names.
 
@@ -1037,13 +1037,13 @@ before using these. If you have no idea what these do, read rfc 2812
 @code{*unspecified*} always, so don't use the return value for
 anything.
 
-@defun bot:send-ctcp to command message
+@defun bot:ctcp to command message
 @var{to} is the target of your CTCP message, @var{command} is the
 CTCP command, and @var{message} is the message (or arguments) of the
 command. Make sure to @code{bot:ctcp-quote} the message!
 @end defun
 
-@defun bot:send-ctcp-reply to command message
+@defun bot:ctcp-reply to command message
 @var{to} is the target of your CTCP reply, @var{command} is the
 CTCP command, and @var{message} is the message (or arguments) of the
 command. Make sure to @code{bot:ctcp-quote} the message!
index da526c4..1939e6e 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.
 
 #ifndef COMMANDS_H
 #define COMMANDS_H
index 27ad0fb..f1487ae 100644 (file)
@@ -208,7 +208,7 @@ interp_init_helper (void* unused)
   bot_new_procedure ("bot:nick", (SCMFunc)ScriptCommands::Nick, 1, 0, 0);
 
   scm_c_define_gsubr ("bot:notice", 2, 0, 0, 
-                     (SCMFunc)ScriptCommands::sendNotice);
+                     (SCMFunc)ScriptCommands::Notice);
 
   bot_new_procedure ("bot:op", (SCMFunc)ScriptCommands::Op, 2, 0, 0);
   bot_new_procedure ("bot:part", (SCMFunc)ScriptCommands::Part, 1, 0, 0);
@@ -252,9 +252,9 @@ interp_init_helper (void* unused)
                      (SCMFunc)ScriptCommands::sendDCCChatMessage);
 
   // "Low Level" Message functuions
-  scm_c_define_gsubr ("bot:send-ctcp", 3, 0, 0,
+  scm_c_define_gsubr ("bot:ctcp", 3, 0, 0,
                      (SCMFunc)ScriptCommands::sendCTCP);
-  scm_c_define_gsubr ("bot:send-ctcp-reply", 3, 0, 0,
+  scm_c_define_gsubr ("bot:ctcp-reply", 3, 0, 0,
                      (SCMFunc)ScriptCommands::sendCTCPReply);
 }
 
index cbf39f1..837e5b5 100644 (file)
@@ -363,6 +363,19 @@ ScriptCommands::Nick(SCM nick)
   return scm_long2num(m.getCode());
 }
 
+SCM
+ScriptCommands::Notice (SCM to, SCM message)
+{
+  VERIFY_STRING (to);
+  VERIFY_STRING (message);
+
+  return (scm_long2num 
+         (Commands::Notice (Interp::bot, 
+                            Utils::scm2str (to),
+                            Utils::scm2str (message)).getCode ()));
+  
+}
+
 SCM
 ScriptCommands::Op(SCM channel, SCM who)
 {
@@ -670,16 +683,4 @@ ScriptCommands::sendCTCPReply (SCM to, SCM command , SCM message)
 }
 
 
-SCM
-ScriptCommands::sendNotice (SCM to, SCM message)
-{
-  VERIFY_STRING (to);
-  VERIFY_STRING (message);
-
-  return (scm_long2num 
-         (Commands::Notice (Interp::bot, 
-                            Utils::scm2str (to),
-                            Utils::scm2str (message)).getCode ()));
-  
-}
 #endif
index ab8b9aa..53f5205 100644 (file)
@@ -56,6 +56,7 @@ public:
   static SCM Msg(SCM, SCM);
   static SCM NextServer(void);
   static SCM Nick(SCM);
+  static SCM Notice (SCM, SCM);
   static SCM Op(SCM, SCM);
   static SCM Part(SCM);
   static SCM Reconnect(void);
@@ -94,7 +95,6 @@ public:
   SCM sendKick(SCM, SCM, SCM);
   SCM sendNick(SCM);
   */
-  static SCM sendNotice(SCM, SCM);
   /*
   SCM sendPart(SCM);
   SCM sendPass(SCM);
index 4fa02c0..c644964 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"
@@ -43,18 +44,26 @@ ServerQueue::addItem(ServerQueueItem *sqi)
 {
   std::list<ServerQueueItem *>::iterator it, it2;
 
-  for (it = serverQueue.begin(); it != serverQueue.end(); ++it) {
-    if ((*it)->priority > sqi->priority)
-      break;
-  }
-  it2 = it; --it2;
-  if (it2 != serverQueue.end() && *it2) {
-    // All right, we try to merge this item to the previous
-    if ((*it2)->merge(sqi)) {
-      delete sqi;
-      return;
+  for (it = serverQueue.begin(); it != serverQueue.end(); ++it)
+    {
+      if ((*it)->priority > sqi->priority)
+       {
+         break;
+       }
+    }
+
+  it2 = it; 
+  --it2;
+  if (it2 != serverQueue.end() && *it2) 
+    {
+      // All right, we try to merge this item to the previous
+      if ((*it2)->merge(sqi)) 
+       {
+         delete sqi;
+         return;
+       }
     }
-  }
+
   serverQueue.insert(it, sqi);
 }
 
@@ -71,17 +80,25 @@ ServerQueue::flush()
 {
   // Called every second, we decrement the penalty
   if (penalty > 0)
-    penalty--;
-
-  while (!serverQueue.empty() && (penalty < 5)) {
-    ServerQueueItem * sqi = (*serverQueue.begin());
-    penalty += sqi->penalty + sqi->getLine().length()/100 + 1;
-    bool res = sendLine(sqi->getLine());
-    serverQueue.erase(serverQueue.begin());
-    delete sqi;
-    if (!res)
-      return false;
-  }
+    {
+      penalty--;
+    }
+
+  while (!serverQueue.empty() && (penalty < 5)) 
+    {
+      ServerQueueItem * sqi = (*serverQueue.begin());
+      penalty += sqi->penalty + sqi->getLine().length()/100 + 1;
+
+      bool res = sendLine(sqi->getLine());
+      serverQueue.erase(serverQueue.begin());
+      delete sqi;
+
+      if (!res)
+       {
+         return false;
+       }
+    }
+
   return true;
 }
 
@@ -108,18 +125,18 @@ ServerQueue::sendCTCP(String to, String command,
     }
   else
     Interp::bot->botInterp->RunHooks (Hook::SEND_CTCP,
-                                  MNICK + " " + to + " " +
-                                  command + " " + message,
-                                  scm_listify (Utils::
-                                             str2scm (MNICK),
-                                             Utils::
-                                             str2scm (to),
-                                             Utils::
-                                             str2scm
-                                             (command),
-                                             Utils::
-                                             str2scm (message),
-                                               SCM_UNDEFINED));
+                                     MNICK + " " + to + " " +
+                                     command + " " + message,
+                                     scm_listify (Utils::
+                                                  str2scm (MNICK),
+                                                  Utils::
+                                                  str2scm (to),
+                                                  Utils::
+                                                  str2scm
+                                                  (command),
+                                                  Utils::
+                                                  str2scm (message),
+                                                  SCM_UNDEFINED));
 #endif
 
 }
@@ -225,13 +242,12 @@ ServerQueue::sendPrivmsg(String dest, String message)
       Interp::bot->botInterp->RunHooks (Hook::SEND_PUBLIC,
                                        Interp::bot->nickName + " " + dest +
                                        " " + message,
-                                       scm_listify (Utils::
-                                                    str2scm (Interp::bot->nickName),
-                                                    Utils::
-                                                    str2scm (dest),
-                                                    Utils::
-                                                    str2scm
-                                                    (message), SCM_UNDEFINED));
+                                       scm_listify 
+                                       (Utils::str2scm 
+                                        (Interp::bot->nickName),
+                                        Utils::str2scm (dest),
+                                        Utils::str2scm (message), 
+                                        SCM_UNDEFINED));
     else
       Interp::bot->botInterp->RunHooks 
        (Hook::SEND_MESSAGE,
index 8fa879f..e67bae2 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.
 
 #include "StringTokenizer.H"
 #include "ServerQueue.H"
index ee3d472..c57838e 100644 (file)
@@ -13,7 +13,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.
 
 #ifndef SERVERQUEUEITEM_H
 #define SERVERQUEUEITEM_H
index 0929018..4db00ff 100644 (file)
@@ -13,7 +13,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.
 
 #ifndef USERCOMMANDS_H
 #define USERCOMMANDS_H