Giuseppe Bilotta [Tue, 27 Jan 2009 01:14:33 +0000 (02:14 +0100)]
url plugin: urls info should work regardless of config
The 'urls info' command to manually query for link information should
always work, regardless of the setting of the url.only_on_channels
config setting.
Fix by making the channels list for handle_urls() into an option
(defaulting to url.only_on_channels) and passing an empty list from
info().
Giuseppe Bilotta [Sun, 25 Jan 2009 23:47:04 +0000 (00:47 +0100)]
rss plugin: parseRss returns the number of found items
Change the parseRss routine to return the number of found items, or nil
in case of error. This helps clearly differentiate between empty feeds
(which are still legit) and b0rked feeds.
This change in logic does not alter the fact that a feed update with no
items will not wipe existing old feed items.
Giuseppe Bilotta [Fri, 23 Jan 2009 01:34:23 +0000 (02:34 +0100)]
launch_here: rewrite git revision retrieval
Use low-level ('plumbing') git commands to retrieve the current
commit/revision/work tree status when we're being launched from a git
tree. This is faster (less shell escapes) and should work equally well
with all git versions (past, present and future).
Giuseppe Bilotta [Thu, 22 Jan 2009 22:29:50 +0000 (23:29 +0100)]
launch_here: add commit subject rather than svn id to revision
There are no git-svn-ids in our repository, so don't look for them.
Instead, put the last commit subject next to the revision to ease
identification of the commit.
Simon Hafner [Wed, 21 Jan 2009 15:49:31 +0000 (16:49 +0100)]
+ (reply) config option to force reply to query
+ (reply) symbol to bypass the config option
* (plugins) fixed url according to the patch
The symbols are:
:to => :public force the message to be replied in channel (if any)
:to => :private force the message to be replied in private
:to => :auto takes core.private_replies (default)
Simon Hafner [Wed, 21 Jan 2009 14:53:01 +0000 (15:53 +0100)]
+ (reply) add new option to control nick prefixing
Message#reply() now accepts a :reply option
:nick => false don't prefix nick
:nick => true prefix nick
:nick => :auto take core.reply_with_nick (default)
Giuseppe Bilotta [Thu, 15 Jan 2009 19:30:06 +0000 (20:30 +0100)]
ircbot: fix reconnect() waiting
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.
An empty String is not false in Ruby, so check for it properly. Also,
find_fortune needs a message passed to it, to be used when it discovers
the correct path.
Sometimes the bot may receive incomplete or malformed mode lines. This
can be seen for example by kicking repeatedly and at very short
intervals the bot from a channel with +l set to some numbers (at least
on freenode).
We (don't) handle these malformed modelines by skipping them rather than
crashing.
Giuseppe Bilotta [Tue, 16 Dec 2008 00:55:44 +0000 (01:55 +0100)]
utils.rb: Utils.age_string to replace distance_of_time_in_words
We define a new age_string function which is a cleaner version of
distance_of_time_in_words. The latter gets removed as its only
in-tree usage was from timeago (which is the UI version that should
be used by plugins anyway).
Utils.timeago gets a revamp too, exploiting the new age_string function.
Giuseppe Bilotta [Thu, 20 Nov 2008 14:17:27 +0000 (15:17 +0100)]
rss plugin: prevent double UTF-8 deconding
The rss parser looks at the encoding specified into the XML file and
converts everything to UTF-8. Since we do the UTF-8 conversion
ourselves, monkey-patch the XML 'encoding' declaration to claim it's
UTF-8 already (as it actually is).
Giuseppe Bilotta [Mon, 17 Nov 2008 15:37:57 +0000 (16:37 +0100)]
azgame plugin: support autoadding words to wordlist
When the game is started with a wordlist it's possible to specify a
language to use for existence of words. When a word is not found in the
wordlist, it's checked against the given language check function, and if
present it's added to a specific file (autoadd-#{language}), which is
also used on load to choose the word to pick.
Giuseppe Bilotta [Mon, 27 Oct 2008 21:59:07 +0000 (22:59 +0100)]
UNO plugin: give cards to correct player at endgame
If the winner played a Reverse in response to a picker, the previous
player should pick the cards, and not the next one. This is not really
important at the moment because we score by giving points to the winner
instead of taking them from losers, but we fix it for correctness. It'll
be especially useful when we'll implement the other scoring too.
Casey Link [Mon, 27 Oct 2008 19:54:16 +0000 (15:54 -0400)]
* (lastfm) fix a bug resulting in the change of the lastfm api output. now_playing works again
Lastfm removed the <date> element from track's which are currently being played, which caused the plugin to die. Now we detect if the <date> element exists.
Keep a track of exceptions to a global 'quiet' command so that user can
use !quiet and !talk in here to make the bot only talk in one channel
without quiet-ing it by hand in each one of the other channels.
message.rb: fix the fix to message addressing logic
This reverts commit b6bd9a24014ac9fbc822e9051f216f0506f24cd5
"message.rb: fix message addressing logic" since it actually breaks the
validity for address? in a number of cases.
Instead, add proper @address setting to NickMessage which is the only
one getting it wrong presently.