summaryrefslogtreecommitdiff
path: root/lib/rbot/ircbot.rb
AgeCommit message (Collapse)Author
2014-03-06[config] adds a new param store_defaultMatthias H
Creates a new option to store the default at first run. This fixes the problem that random auth passwords are not kept, it also allows us to always store the core.db config value.
2014-03-05[registry] migrate tc directory name to registry_tcMatthias Hecker
2014-03-05[ssl] fix for missing ca pathMatthias Hecker
2014-03-05[registry] use tc by-default if availableMatthias Hecker
2014-02-24[registry] refactoring into a abstract and factoryMatthias H
* a new abstract class AbstractAccessor is the new base for all concrete database implementations. * a factory now, dynamically discovers those implementations in the registry/ directory and will create the configured type for the plugins. * again: this makes db keys case-sensitive (aka 'the correct way of doing things' -.-) * re-added tokyocabinet
2014-02-24[agent] wip core mechanize agent pluginMatthias H
2014-02-21[webservice] control bot through http interfaceMatthias H
2014-02-19[registry] registry folder with suffix, added daybreak engineMatthias H
2014-02-18log fatal/error messages to stderr, but check if daemonized first!Matthias H
2014-02-18remove old/compat code no longer supportedMatthias H
2014-02-18removes bdb&tc registry; adds dbm registryMatthias H
This removes the existing registries, ruby-bdb (Berkeley DB) and tokyocabinet, instead it creates a new registry based on ruby DBM. Ruby-bdb has long since been abandoned in favor for rubys DBM and tokyocabinet also has been ceased development since 2011 (for kyotocabinet).
2013-12-06workaround for broken pretty_inspectMatthias H
2013-12-04Revert "always print FATAL and ERROR logmessages to STDERR"Matthias Hecker
This reverts commit c4d629ad86aae3b8bb4669650df57875252bea92.
2013-11-14always print FATAL and ERROR logmessages to STDERRMatthias Hecker
This adds a print to $stderr for log messages with the level ERROR or FATAL. I did this because in the past errors connecting to the server weren't immediately obvious but rather hidden in the logfile. I think it should be right in-your-face when the connection doesn't work. It would probaply be better to extend Logger to print to STDERR but this apparently requires monkeypatching ruby's Logger. Anyhow I think my solution works for now.
2013-11-14allow to verify ssl connections against a CA.Matthias H
This adds three new configuration variables to configure SSL verification against a CA. server.ssl_verify: true if it should verify and disconnect if it fails server.ssl_ca_file: a CA file, is set to the systems CA bundle by default (distri. dependent) server.ssl_ca_path: alternativly path to a directory with CA PEM files I tested it and this seems no longer an issue with >= 1.9.3 https://www.braintreepayments.com/braintrust/sslsocket-verify_mode-doesnt-verify
2013-11-02ruby 2.0.0: better fix for the ThreadErrorMatthias H
I revisited my fix for the ThreadError in ruby 2.0.0 this doesn't use a queue for signals but just starts a thread for each received signal, works much better for me. It also fixes a bug in Bot#reconnect where the SystemExit exception coming from quit is not handled correctly.
2013-11-02ruby 2.0.0: changes sigtrapping, fixes ThreadErrorMatthias H
Ruby 2.0.0 crashes with "ThreadError: can't be called from trap context" anytime a signal is received, because it tries to write a debug message within the "trap context". This changes signal handling so that signals are queued and processed in the main loop. More information: https://www.ruby-forum.com/topic/4411227
2011-10-24Exit for good when getting a DBFatal errorGiuseppe Bilotta
2011-09-15Better handling of akills and other form of disconnectionsGiuseppe Bilotta
2011-06-11Saner treatment for connect errorsGiuseppe Bilotta
Rather than raising changing the message (a message that would not be displayed anyway), display the (composed) error message and then reraise without further changes.
2011-05-03Preliminary support for the LIST commandGiuseppe Bilotta
2011-04-03* less eager quit message resetGiuseppe Bilotta
Only reset quit message when entering the main loop sanely.
2011-01-31comments and message fixesGiuseppe Bilotta
2010-09-27* wrap BDB::Fatal classes for abstract trappingGiuseppe Bilotta
When using a DB backend different from BDB, the BDB constant may not be defined, causing a NameError during error trapping in the main loop. Fix this by defining our own DBFatal error that maps to BDB::Fatal in the BDB case and is defined as an (unused) Exception for TokyoCabinet.
2010-03-16Tokyo Cabinet DB backendVoker57
2010-03-16DB backend optionVoker57
2010-03-16Moved DB stuff to registry/bdbVoker57
2009-12-21ircbot/rfc2812/message: Add banlist message handlingAlex Legler
2009-12-21ircbot: Delegate ERR_NOSUCHNICK and ERR_NOSUCHCHANNEL events to pluginsAlex Legler
2009-10-21Loop until connected in reconnect()Giuseppe Bilotta
Untrapped connect() failures would raise up to the mainloop, causing a burst of reconnect attempts without delay. Fix by rescuing in reconnect() and retrying after waiting.
2009-08-26ruby 1.9: fix *methods.include?franz
Since in 1.9 methods arrays have symbols instead of strings, fix it by changing into respond_to? and method_defined?
2009-08-26ruby 1.9: convert Exception to string explicitlyfranz
changed "string + exception" to "string #{e}", the former yields 'can't convert <e> into String' in ruby 1.9
2009-08-26ircbot: fix indentation errorfranz
2009-08-16Suppress warnings about unitialized variablesGiuseppe Bilotta
hangman: an unneeded letters accessor was defined ircbot: restore initializations removed by previous commit
2009-08-14ircbot: clean up ping timings on connectGiuseppe Bilotta
2009-05-21multiple plugins: Changes to remove parenthesize warnings.David Gadling
All of these modules/plugins were generating warnings like this: warning: parenthesize argument(s) for future version This patch should fix all the warnings without affecting functionality.
2009-05-06ircbot: reinstante @bot.channelsGiuseppe Bilotta
When the new IRC framework was introduced, the old @channels Hash and its accessor for @bot were dismissed. Reintroduce it for backwards compatibility.
2009-03-06load rubygems if availableGiuseppe Bilotta
Try loading rubygems as soon as we're set up, since it can be needed for gettext and a number of other things. This also allows us to get rid of some stupid convoluted tricks in utils.
2009-03-03ircbot: enable gettext on "restarting, back in..."Raine Virta
2009-02-28Separate @dirs containing all botmodules (plugins and core modules)Raine Virta
into @core_module_dirs and @plugin_dirs
2009-02-17ircbot: fix nil error variable on ServerErrorGiuseppe Bilotta
We were making use of an undefined variable e when catching ServerError in the main loop.
2009-02-15+ @bot.path and datafile methodsGiuseppe Bilotta
We provide two methods that make it more simple and elegant for botmodules to define paths relative to the bot's own directory (botclass) and to the BotModule's (assumed) non-registry directory. The first method is Irc::Bot#path(), which joins its arguments with the botclass. This method can be used to access datafiles in the bot directory with a much cleaner syntax; and since it uses File.join, the resulting paths are also properly formatted on each platform, which doesn't hurt. Each BotModule now also carries a dirname() method that should return the directory under botclass that holds the BotModule's datafiles. dirname() defaults to the BotModule's name(), but it can be overridden, e.g. for backwards compatibility (see the patch for the quotes plugin), or for BotModules that share their datafiles. Datafiles can be accessed using the BotModule#datafile() method that joins the botclass, the dirname() and whatever other argument is passed.
2009-02-15ircbot: refactor and clean up botclass dir handlingGiuseppe Bilotta
Use File.join across the board, and refactor some botclass directory handling. Most important changes: * failure to create the registry and safe_save directory is now fatal; * failure to create the local plugin directory prevents it from being added to the plugin path (with a warning); * botclass directory update from templates is now a standalone routine called during init, making it possible to use it in other cases too.
2009-02-11ircbot: sendmsg filteringGiuseppe Bilotta
We allow a filter to manipulate the arguments of sendmsg() by running them through the filters of the :sendmsg group. The DataStream passed to the filters has four keys: :text => the message text :type => the message type (typically, PRIVSMG or NOTICE) :dest => the destination (typically, a Channel or User) :options => options passed to sendmsg, merged with the default ones
2009-02-01ircbot: suppress warningGiuseppe Bilotta
parenthesize argument(s) for future version
2009-01-28ircbot: optimize ignore loopsGiuseppe Bilotta
Break early from ignore checks, and skip them altogether when the message is ignored already.
2009-01-28ircbot: irc.ignore_channels config optionGiuseppe Bilotta
In some circumstances the user might want to turn the bot into a pure logbot for some channels. This can now be achieved by adding that channel to the irc.ignore_channels config key, that makes the bot ignore all PRIVMSG to that channel (note that notices and service messages such as joins and parts are still acted on, just like for irc.ignore_users).
2009-01-28ircbot: the reconnect must be protectedGiuseppe Bilotta
The reconnect() call in the main loop must be protected in the begin/rescue blocks. Most of the rescue blocks can be fall-through, because the begin/end is wrapped in a loop. The only exception is the ServerError block that issues a retry lest too_fast is reset to false even when it should be true.
2009-01-15ircbot: fix reconnect() waitingGiuseppe Bilotta
The refactored reconnect() method would only wait when the socket was connected at the time it got called. In case where the socket would have closed earlier (e.g. because of a network I/O error) it would reconnect directly, which would for example fail to prevent fast reconnections. Fix by fencing the wait code with a check for @last_rec (checked before the optional disconnect) rather than keeping it with the socket connect check, and always initializing @last_rec on socket connect. A side effect of this strategy is that reconnect() will only wait if the bot was previously connect, or if it got disconnected by anything but the disconnect() method. Callers of disconnect() should take care of waiting themselves if they plan to reconnect.
2009-01-15ircbot: SIGUSR1 forces a reconnectGiuseppe Bilotta