1 2005-01-12 Clinton Ebadi <clinton@unknownlamer.org>
3 * source/BotConfig.C (set_option_value): Put watcher calling
4 inside of if (cf_iter != end()) to fix a segfault (if the cf_iter
5 = end then there are no watchers since this is a new value and
6 references cf_iter->second segfaults)
8 * source/Utils.C (trim_str): Fixed bug (last non-space character
11 * source/BotConfig.C (read_config): Made to use set_option_value
12 instead of manipulating options_db directly
14 * source/BotConfig.H (class BotConfig): Add set_option_value that
15 takes a t_value instead of t_value_list (most uss of
16 set_option_value will be to add a single value so this is very useful)
18 * source/BotConfig.C (set_option_value): Implemented
20 * source/UserList.C: Made to work with new Utils/StringTokenizer names
22 * source/UserCommands.C: Made to work with new
23 Utils/StringTokenizer names
25 * source/ShitList.C: Uses Utils.H now (Utils::trim_str & friends)
27 2005-01-11 Clinton Ebadi <clinton@unknownlamer.org>
29 * source/ShitList.C: Made to work with new StringTokenizer names
31 * source/ServerQueueItem.C: Made to work with new StringTokenizer names
33 * source/ServerQueue.C: Made to work with new Utils names
35 * source/ScriptCommands.C: Made work with new Utils names
37 * source/Person.C (getNick): Made work with new Utils names
39 * source/String.H: Added substr prototypes
41 * source/String.C (substr): Added substr as an alias of subString
42 (for compat with std::string before the transition)
44 * source/Parser.C: Made to work with new Utils/StringTokenizer names
46 * source/DCCParser.C: Made to work with new Utils names
48 * source/DCCChatConnection.C: Made to work new Utils names
50 * source/Commands.C: Made to work with new Utils names
52 * source/Channel.C: Made to work with new Utils names
54 * source/BotInterp.C: Made to work with new Utils
56 * source/Bot.C: Made to work with new Utils/StringTokenizer names
58 * source/String.C (operator=): Unremoved operator=(std::string)
60 * source/String.H: Unremoved operator=(std::string)
62 * source/BotConfig.C (read_config): Use Utils::trim_str
64 * source/String.C (trim): Fixed bug (p->s[i] == '\r', s/i/j/)
66 * source/Utils.C (trim_str): Implemented
68 * source/Utils.H: Added tim_str (replaces String::trim)
70 * source/BotConfig.C: Made everything work with new
71 StringTokenizer and Utils names
73 * source/Utils.H: Added to_lower
76 * source/StringTokenizer.C (rest): uses std::isspace instead of
77 checking st[pos] against ' ' and '\t'
79 * source/StringTokenizer.H: Removed CamelCasing
80 Renamed hasMoreTokens to more_tokens_p
82 * source/StringTokenizer.C: Converted to use std::string
84 * source/StringTokenizer.H: Converted to use std::string
86 * source/String.C: Removed operator=(std::string)
88 * source/String.H: Removed operator=(std::string)
90 * source/Utils.C: Added copyright
91 Reformatted to match GNU coding standard more closely
92 Converted everything to use std::string
93 (get_nick): Renamed from getNick
94 (get_userhost): Renamed from getUserHost
95 (get_key): Renamed from getKey
96 (IP_p): Renamed from isIP
97 (make_wildcard): Renamed from makeWildcard
98 (channel_p): Renamed from isChannel
99 (wildcard_p): Renamed from isWildcard
100 (valid_channel_name_p): Renamed from isValidChannelName
101 (valid_nickname_p): Renamed from isValidNickName
102 (get_level): Renamed from getLevel
103 (str2time): Renamed from strToTime
104 (str2time): Fixed potential buffer overflow (num[512] => std::string)
105 (level2str): Renamed from levelToStr
106 (prot2str): Renamed from protToStr
107 (bool2str): Renamed from boolToStr
108 (long2str): Implemented
109 (scm2str): Renamed from scm2String
110 (str2scm): Renamed from string2SCM
112 * source/BotConfig.C: Reformatted to fit GNU coding style more closely
114 * source/Utils.H: Added long2str (long int -> std::string)
116 * source/String.H: Added 2003 copyright (the year I last modified
119 * source/String.C: Added 2002 copyright (the year I last modified
122 * source/Utils.H: Updated Copyright
123 s/String/std::string/g
124 Removed camel casing and is* = *_p
127 * source/BotConfig.C: Updated Copyright
129 * source/BotConfig.H: Updated copyright
131 2005-01-08 Clinton Ebadi <clinton@unknownlamer.org>
133 * source/BotConfig.C (set_option_value): Take care of the case
134 where key is not already in the db
135 (add_watcher): Implemented
136 (read_config): Removed ',' token parsing (not needed)
138 * configure.ac: Add AC_LANG([C++]) so we can check for C++ libs
139 AC_CHECK_LIB ccgnu2 (CommonC++2)
141 * README: Updated README (reformatted, adding info, etc.)
143 2005-01-07 Clinton Ebadi <clinton@unknownlamer.org>
145 * source/BotConfig.C (set_option_value): call watcher list
146 (run_fun_): Added to support watcher list calling
148 2005-01-06 Clinton Ebadi <clinton@unknownlamer.org>
150 * source/BotConfig.C (set_option_value): Fuck you STL
151 (push_back_): Reimplemented so that it doesn't need std::bind1st
152 because the STL is being stupid
154 2004-12-26 Clinton Ebadi <clinton@unknownlamer.org>
156 * source/BotConfig.C (read_config): Implemented properly
157 (get_option_values): Implemented properly
158 (set_config_file): Fixed
160 2004-07-10 Clinton Ebadi <clinton@unknownlamer.org>
162 * bobot++.texinfo (Built-In Commands): Added empty stubs to the
165 2004-06-22 Clinton Ebadi <clinton@unknownlamer.org>
167 * source/BotConfig.C: New file (implementation of configuration database)
169 * source/BotConfig.H: New File (semi-generic configuration database)
171 2004-06-17 Clinton Ebadi <clinton@unknownlamer.org>
173 * bobot++.texinfo (Starting the Bot): New section
175 2004-06-14 Clinton Ebadi <clinton@unknownlamer.org>
177 * bobot++.texinfo (Protection): Added Section
178 (User Levels): Rewrote section to be useful
179 (bot.users): Added section
181 2004-06-12 Clinton Ebadi <clinton@unknownlamer.org>
183 * source/DCCChatConnection.C (connect): Checks to make sure the
184 person initiating a DCC CHAT with the bot is at least a FRIEND of
187 * README: Fixed a typo
189 * scripts/bobot-utils.scm (ctcp-quote): Implemented ctcp-quote
190 (bot:ctcp-quote): Renamed ctcp-quote to bot:ctcp-quite (whoops)
192 2004-05-28 Clinton Ebadi <clinton@unknownlamer.org>
194 * bobot++.texinfo (bot.conf): Finished section
195 (server syntax): New section, documents the bot.conf SERVER syntax
196 (channel syntax): New section, documentes the bot.conf CHANNEL syntax
198 2004-05-13 Clinton Ebadi <clinton@unknownlamer.org>
200 * source/Main.C (real_main): std::exit instead of exit
202 2004-05-12 Clinton Ebadi <clinton@unknownlamer.org>
204 * source/DCCConnection.C (DCCConnection): Intialized `nuh' in the
205 constructor with `n' This should fix the segfaulting.
207 2004-01-28 Clinton Ebadi <clinton@unknownlamer.org>
209 * ChangeLog: Updated copyright notice
211 2004-01-09 Clinton Ebadi <clinton@unknownlamer.org>
213 * source/Interp.C (interp_init_helper): Register
214 bot:change-command-level
216 * source/ScriptCommands.C (ChangeCommandLevel): Added
217 ChangeCommandLevel to change the level a user needs to be to run a
220 * source/ScriptCommands.H: Added ChangeCommandLevel
222 2003-10-12 Clinton Ebadi <clinton@unknownlamer.org>
224 * source/String.H: Changed #define STRING_H to BSTRING_H
226 2003-08-04 Clinton Ebadi <clinton@unknownlamer.org>
228 * scripts/bobot-utils.scm (bot:sent-to-me?): New procedure, used
229 to see if a message was sent to the bot (this is better than
230 bot:match-to-me because the hook isn't invalidated when the bot's
233 * source/DCCConnection.H: Added `nuh' back and added an
235 Added setter `set_autoRemove(bool)'
237 * source/DCCConnection.H: Removed all friends
238 Added accessors (get_bot, get_lastSpoken, get_autoRemove; get_bot
239 reveals the pointer to the bot [PRIVATE POINTER] which probably
240 isn't so nice, but there isn't much to be done about it with the
241 current design of the bot)
243 * source/DCCChatConnection.H: Removed all friends
245 * source/DCCConnection.H: DCCConnection is now a pure virtual
246 class with the subclass DCCChatConnection
248 2003-07-29 Clinton Ebadi <clinton@unknownlamer.org>
250 * source/Socket.C (connect): log errors to the bot log instead of
253 2003-07-23 Clinton Ebadi <clinton@unknownlamer.org>
255 * source/Parser.C (parseMessage): use the find method of std::map
256 to find the command to call instead of [] and then extract the
257 pointer to the userFunction from that if it exists. This appears
258 to fix the crash when one uses an undefined command followed by
261 2003-04-09 Clinton Ebadi <clinton@unknownlamer.org>
263 * source/Interp.C (interp_init_helper): Bind bot:setfloodrate to
264 ScriptCommands::SetFloodRate
266 * source/ScriptCommands.C (SetFloodRate): New Method: SetFloodRate
268 * source/Bot.C (init_user_functions): Make SETFLOODRATE available
271 * source/Bot.H: Made MAX_MESSAGES writeable
273 * source/UserCommands.H: New method: SetFloodRate
275 * source/Commands.H: New method: SetFloodRate
277 2003-04-03 Clinton Ebadi <clinton@unknownlamer.org>
279 * configure.ac: Merged all AC_OUTPUTs at the end
281 2003-04-02 Clinton Ebadi <clinton@unknownlamer.org>
283 * scripts/bobot-utils.scm: Make exported symbols from
284 the-bot-module available in the guile-user module so that scripts
285 loaded with Interp::Load function.
287 2003-03-30 Clinton Ebadi <clinton@unknownlamer.org>
289 * scripts/bobot-utils.scm (bot:load-module): Loads a file from the
290 %bot:loadpath into its own module and returns that (unnamed) module
291 (bot:use-module): Calls bot:load-module and then adds the newly
292 loaded module to the (current-module)'s use-list
294 * source/Interp.C (interp_init_helper): New procedure to initialize
295 the-bot-module (this is the old Interp::Startup verbatim)
296 (interp_post_startup_helper): New procedure to export
297 the-bot-module from bot_module
298 (Startup): Now calls interp_init_helper and
299 interp_post_startup_helper to initalize the bot module system
301 * source/Interp.H: Added private variable bot_module to Interp
303 2002-11-04 Clinton Ebadi <clinton@unknownlamer.org>
305 * scripts/bobot-utils.scm: Added bot: to regex functions (yes,
306 this breaks existing scripts, this is the unstable tree after all)
308 2002-11-03 Clinton Ebadi <clinton@unknownlamer.org>
310 * source/Mask.C (match): Made Mask::match case insensitive
312 2002-09-23 Clinton Ebadi <clinton@unknownlamer.org>
314 * source/Interp.C (scm_apply_wrapper): turned off locking of
315 Interp::mutex to see if this makes the bot work again...and it
318 2002-09-07 Clinton Ebadi <clinton@unknownlamer.org>
320 * configure.ac: Removed arguments to AM_INIT_AUTOMAKE and updated
321 everything to use aclocal/automake 1.6
323 2002-08-27 Clinton Ebadi <clinton@unknownlamer.org>
325 * source/DCCPerson.H (class DCCPerson): Added
326 UserCommands::DCCList as a friend (friends are better than the old
327 DCC() function at least).
329 * source/DCCManager.H (class DCCManager): Added
330 UserCommands::DCCList as a friend
332 * source/Interp.H (class Interp): Made function scm_apply_wrapper
333 a friend so it can lock Interp::mutex
335 * source/Interp.C (scm_apply_wrapper): Lock Interp::mutex if
336 MULTITHREAD is defined (it is always defined when scripting is
337 enabled) so that Sockets can be made multithreaded using
340 * source/DCCPerson.H: Removed DCC method and made Bot a friend
341 Made DCCManager a friend
343 * source/DCCManager.H (class DCCManager): Removed MAP() method
344 and made Bot a friend of DCCManager
346 2002-08-18 Clinton Ebadi <clinton@unknownlamer.org>
348 * source/Interp.C (Startup): Renamed bot:DCC-chat-send to
351 * bobot++.texinfo (Hook Types): Fixed a typo (I wrote
352 user!nick@host instead of the correct nick!user@host).
354 * source/Interp.C (Startup): Register bot:DCC-chat-send
356 * source/ScriptCommands.C (sendDCCChatMessage): Added method again
358 2002-08-08 Clinton Ebadi <clinton@unknownlamer.org>
360 * source/String.C (String): The std::string copy constructor now
361 extracts the c_str of the std::string and then takes the strlen of
362 that before copying it. This fixes a bug with DCC where if you did
363 e.g. "!help" the bot would reply with "No TOPIC PRIVMSG FOUND" or
364 something like that, depending on what the last message was
365 because Socket will insert a \0 into its semi-static buffer, so
366 the len of the String will not equal the strlen of its char*.
368 2002-08-07 Clinton Ebadi <clinton@unknownlamer.org>
370 * source/DCCPerson.H: Removed destructor (I = idiot)
372 * source/DCCConnection.H: DCCManager is now a friend of
373 DCCConnection (ugh, the bot has way too many friends).
375 * source/DCCPerson.H: Added DCC member that returns a const
376 DCCConnection* (the dcc connection). This isn't saved anywhere
377 because when a DCCPerson is destroyed, its connection is also
380 * source/Bot.H: dccConnections is now a DCCManager
382 * source/DCCPerson.H: Added destructor
383 Added handleInput method
385 * source/DCCManager.C: New file
386 (addConnection): Wrote method, add a DCCConection to the manager
388 * source/DCCManager.H: New file
390 * source/Interp.C (Startup): Register bot:DCC-chat-send
391 (Startup): Removed sendDCCChatMessage stuff
393 * source/ScriptCommands.C (sendDCCChatMessage): New method:
394 sendDCCChatMessage (to, message) sends message to to.
396 * source/DCCConnection.C (connect): Run DCC_CHAT_BEGIN hook with
397 one arg: from (user!nick@host).
399 * source/DCCParser.C (parseLine): Runs DCC_CHAT_MESSAGE hook with
400 two args: from (user!nick@host) and line
402 2002-08-06 Clinton Ebadi <clinton@unknownlamer.org>
404 * source/Interp.C (Startup): Two new Scheme values:
405 hooks/dcc/chat-begin and hooks/dcc/chat-message for the
406 DCC_CHAT_BEGIN and DCC_CHAT_MESSAGE hooks.
408 * source/BotInterp.H: Added two new enum values to Hook:
409 DCC_CHAT_BEGIN and DCC_CHAT_MESSAGE for the DCC chat start and DCC
412 2002-08-05 Clinton Ebadi <clinton@unknownlamer.org>
414 * source/Parser.C (parseCTCP): Removed call to htonl and fixed
415 DCC! Ack, sockets take their arguments in network byte order so
416 there is no need to convert to host...now DCC _sort of_ works.
418 2002-08-04 Clinton Ebadi <clinton@unknownlamer.org>
420 * source/UserList.C (save): Increment iterator twice to get around
423 * source/ServerQueue.C: Now sends SEND_* hooks instead of
424 triggered general hooks.
426 * source/Interp.C (Startup): New scheme side defines: hooks/send/*
427 (* = the new SEND_ hooks, but lowercase).
429 * source/BotInterp.H: New hook types (SEND_..., ... = ACTION,
430 CTCP, PUBLIC, MESSAGE). These are triggered on send messages.
432 2002-08-01 Clinton Ebadi <clinton@unknownlamer.org>
434 * source/Bot.C (set_log_file): Oops! Fixed logging. Now the bot
437 * source/Socket.C (readLine): Now uses a static std::string that
438 starts out with 512 chars. This will never need to be resized for
439 usualy IRC messages, but might be for DCC messages
441 2002-07-31 Clinton Ebadi <clinton@unknownlamer.org>
443 * scripts/bobot-utils.scm (not-from-me): New syntax.
445 * source/ScriptCommands.C (AddHook): Now takes another optional
446 arg--name that will name the hook (see the hooks section in the
447 manual for what this does).
449 * source/BotInterp.H: Added name field to Hook
451 2002-07-29 Clinton Ebadi <clinton@unknownlamer.org>
453 * source/ServerQueue.C (sendPrivmsg): Now calls hooks on own
454 PRIVMSGes because the IRC server doesn't echo them back to the
455 bot. This could be useful for something (e.g. log script).
457 2002-07-27 Clinton Ebadi <clinton@unknownlamer.org>
459 * source/Interp.C (Shutdown): Runs bot:exit-hook hooks
460 (Startup): New var for Scheme: bot:exit-hook. Calls the thunks
461 associated with the hook when Interp::Shutdown is called (bot exit).
463 2002-07-23 Clinton Ebadi <clinton@unknownlamer.org>
465 * source/BotInterp.H (Hook<): Changed behavior of Hook's <. If a
466 hook is greater than or less than the other hook, only the
467 priority is considered. However, if both hooks have the same
468 priority, then the fallthru-ness is considered, with fallthru
469 hooks being greater than non-fallthru hooks.
471 * source/BotInterp.C (hptr_lt): Added this static function to be
472 used to sort the hooks list (now hooks should be sorted using
473 Hook's operator < instead of using pointer comparision, meaning
474 the new hook system will work correctly)
476 * scripts/bobot-utils.scm: Make bot:log use for-each instead of
477 map because we don't need the result of the displays (this would
478 just be a list of #<undefined> values and is a waste of memory).
480 2002-07-13 Clinton Ebadi <clinton@unknownlamer.org>
482 * source/Bot.C (Bot): userFunctions is now a map for efficiency
483 (worst case search is now NlogN instead of N). This improvement is
484 not as drastic as the one gained by making the Parser functions
485 list a map (because we don't scan this map for every message), but
486 it helps to clean up the code
488 2002-07-12 Clinton Ebadi <clinton@unknownlamer.org>
490 * source/Parser.H: Removed userFunctionsStruct
492 * source/Interp.C (Startup): ScriptCommands::sendCTCP registered
493 as bot:send-CTCP for Scheme
495 * source/ScriptCommands.C (sendCTCP): Wrote sendCTCP
497 2002-07-11 Clinton Ebadi <clinton@unknownlamer.org>
499 * source/ServerQueue.C (sendUser): Changed . . in USER command to
500 0 * (which is the Right Way to because <mode> must be a number...)
502 * source/Parser.C (init): New method of Parse. This initalizes the
503 functions map. functions replaces the old functions array, and
504 should yield better performance (since the functions array had to
505 be scanned for every incoming message)
507 * source/Parser.H: New member, functions (private)
509 2002-07-10 Clinton Ebadi <clinton@unknownlamer.org>
511 * source/Interp.C (Startup): New symbols: bot:user-*
512 [none|user|trusted|friend|master] are defined in Scheme as the
513 different levels of the users.
514 (Startup): All bot-* variables are now bot:*
516 2002-07-09 Clinton Ebadi <clinton@unknownlamer.org>
518 * source/Bot.H: Made some variables private because they shouldn't
519 be changed at runtime
521 * source/Parser.C (parseCTCP): Reneabled DCC CHAT (I want to test
522 this out to see if it works and make it work)
524 * source/Bot.C (Bot::Bot): New var: logs_dir. Set to the log file
527 * scripts/bobot-utils.scm: Fixed a typo (I forgot the / after
528 scripts in the user scripts dir) that made bobot++ not able to
529 load scripts from the user scripts dir
531 2002-07-08 Clinton Ebadi <clinton@unknownlamer.org>
533 * source/BotInterp.C (RunHooks): Changed iterators to
534 reverse_iterators because the hooks list is sorted in ascending
535 order--higher priority and fallthrough hooks appear _after_ the
536 lower priority and non-fallthrough hooks.
538 * source/Main.C (print_long_help): Added function
539 (print_short_help): Renamed from printUsage
540 (namespace): Most stuff in here is now defined in an anonymouse
541 namespace so it doesn't have external linkage
542 (real_main): Uses getopt_long instead of getopt. Added several
543 command line arguments (bobotpp --help for a full list).
545 * scripts/bobot-utils.scm (bot-load): Function moved from
548 * source/Interp.C (Startup): Autoloads
549 PREFIX/bobotpp/scripts/bobot-utils.scm now
550 (Startup): New Scheme variable: bot-sys-scripts-dir (system
553 * source/bobot-scheme.scm.in: Removed
555 * source/Makefile.am: Removed bobot-scheme.scm compiliation
557 * configure.ac (PREFIX): configure.ac defined prefix now
559 * source/Main.C (real_main): Default configuration is now read
560 from /etc/bobotpp/default
561 * source/bobot-scheme.scm.in: Added file. This defines the
562 'bot-load' procedure which will load a file from
563 $HOME/.bobotpp/scripts/ or @datadir@/bobotpp/scripts/ if the
564 script doesn't exist in the user script dir.
566 2002-07-01 Clinton Ebadi <clinton@unknownlamer.org>
568 * bobot++.texinfo: Started docs (just a skeleton right now)
570 * source/ScriptCommands.C (AddHook): Now takes pri and fall opt
571 args to set a hooks priority and whether or not it will
572 fallthrough. These args are optional.
574 * source/Interp.C (Startup): addhook now takes 3 req and 2 opt args
576 * source/BotInterp.C (AddHook): Now uses priority and fallthrough
577 (RunHooks): exec fallthrough hooks first.
579 * source/BotInterp.H: Changed Hooks to have priority
580 Added fhooksMap to BotInterp (fallthrough)
582 * source/UserCommands.C (AddShit): Converted to use Commands
584 2002-06-21 Clinton Ebadi <clinton@unknownlamer.org>
586 * source/Commands.C (AddUser): Fixed a one-off (function call was
587 before a brace instead of after one) that caused a segfault when
588 the user mask was a wildcard
590 2002-06-20 Clinton Ebadi <clinton@unknownlamer.org>
592 * all files: Updated address of the FSF
594 * source/UserCommands.C (AddUser): Uses Commands now instead of
595 manipulating the bot directly
597 2002-06-18 Clinton Ebadi <clinton@unknownlamer.org>
599 * source/ScriptCommands.C (AddShit): Filled in function.
601 * source/Interp.C (Startup): Bind bot-adduser to
602 ScriptCommands::AddUser instead of Action
603 (Startup): Bind bot-addshit to ScriptCommands::AddShit
605 * source/ScriptCommands.C (AddUser): Filled in function
607 * source/ServerList.C (delServer): Changed (n - 1) to n...n-1
608 would have caused problems if you used more than one server
610 * source/Parser.H: Changed const char* to String in userFunctionStruct
612 * source/String.H: Added std::string compatibility members
614 * configure.ac: You can now disable Crypt and scripting
616 * source/*: Added #include "config.h" where needed
618 * configure.ac: Added AM_CONFIG_HEADER
620 * config.h.in: added file
622 * source/Queue.C: Didn't notice iostream.h here! Fixed
625 Copyright 2002,2003,2004 Clinton Ebadi
626 Copying and distribution of this file, with or without modification, are
627 permitted provided the copyright notice and this notice are preserved.