+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
+ 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
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:
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.
@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!
// 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
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);
(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);
}
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)
{
}
-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
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);
SCM sendKick(SCM, SCM, SCM);
SCM sendNick(SCM);
*/
- static SCM sendNotice(SCM, SCM);
/*
SCM sendPart(SCM);
SCM sendPass(SCM);
// 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"
{
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);
}
{
// 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;
}
}
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
}
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,
// 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"
// 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
// 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