Age | Commit message (Collapse) | Author |
|
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.
|
|
|
|
|
|
|
|
* 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
|
|
|
|
|
|
|
|
|
|
|
|
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).
|
|
|
|
This reverts commit c4d629ad86aae3b8bb4669650df57875252bea92.
|
|
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.
|
|
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
|
|
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.
|
|
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
|
|
|
|
|
|
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.
|
|
|
|
Only reset quit message when entering the main loop sanely.
|
|
|
|
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.
|
|
|
|
|
|
|
|
|
|
|
|
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.
|
|
Since in 1.9 methods arrays have symbols instead of strings, fix it by
changing into respond_to? and method_defined?
|
|
changed "string + exception" to "string #{e}", the
former yields 'can't convert <e> into String' in ruby 1.9
|
|
|
|
hangman: an unneeded letters accessor was defined
ircbot: restore initializations removed by previous commit
|
|
|
|
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.
|
|
When the new IRC framework was introduced, the old @channels Hash and
its accessor for @bot were dismissed.
Reintroduce it for backwards compatibility.
|
|
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.
|
|
|
|
into @core_module_dirs and @plugin_dirs
|
|
We were making use of an undefined variable e when catching ServerError
in the main loop.
|
|
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.
|
|
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.
|
|
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
|
|
parenthesize argument(s) for future version
|
|
Break early from ignore checks, and skip them altogether when the
message is ignored already.
|
|
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).
|
|
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.
|
|
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.
|
|
|