David Gadling [Sat, 13 Mar 2010 05:53:06 +0000 (21:53 -0800)]
url: Add a config option to auto-shorten URLs.
shortenurls: Add a favorite service config option.
Auto-shortening URLs is mutually exclusive with showing information about them as the output would be very confusing.
The favorite shortenting service option only really applies when other plugins call shortenurls.shorten, so they don't have to hard-code which shortening service to use.
David Gadling [Wed, 3 Feb 2010 02:43:38 +0000 (18:43 -0800)]
autoop: Add a 'restore' command that will op anybody that would be autooped.
This goes through the list of hostmasks that would be opped in the channel, and
checks to see if any of them are currently not opped. If they're not, they're opped.
Giuseppe Bilotta [Mon, 28 Jun 2010 22:55:10 +0000 (00:55 +0200)]
Move English messages from po/en_US to po/en
When using gettext, the bot will look for English messages in the 'en'
locale, rather than en_US. This causes some Ruby GetText version to
not find the .mo files, which used to be stored as en_US instead. Since
Ruby's GetText seems to be too stupid to fall back to en_US when en is
not found, we move the messages to en.
This is also probably more correct from a linguistic standpoint, since
the messages are actually mostly British English due to the bot origin.
Yaohan Chen [Fri, 21 May 2010 19:59:29 +0000 (15:59 -0400)]
translator: connect to sites only when necessary
Previously the translation services in the plugin would connect to their
respective websites on initialize. Now they will only do this when the first
time they are used. WorldLingo still connects on initialialize in order to list
the supported language pairs, but the Mechanize object is not saved here, so
the connection should be closed after initialize, and only reopened if
translation by WorldLingo is requested later.
Previously the services are assumed to fail if they raise any Exception in
initialize, and in that case the service is disabled, and its command as well
as the help translate [failed] commands state this. Now this exception catch is
done for any do_translate method call.
Giuseppe Bilotta [Wed, 12 May 2010 10:57:40 +0000 (12:57 +0200)]
Survive active_support idiocy
Somebody should hang the ActiveSupport developers by their balls
with barbed wire. Their MissingSourceFile extension to LoadError
_expects_ a second argument, breaking the usual Exception interface
(instead, the smart thing to do would have been to make the second
parameter optional and run the code in the from_message method if
it was missing).
translator: additional help for google translate auto-detect failure
When translate command is used without source language, "auto" as source
language is assumed. It means that google translator is used and we let
google figure out what the source language is.
Problem is that the google translator will fail if the system that the
bot is running on does not have the json gem installed. This commit
addresses that problem by showing more informative error message instead
of a weird "none of the translators supports auto to en translation".
Giuseppe Bilotta [Tue, 16 Mar 2010 14:16:20 +0000 (15:16 +0100)]
seen: use corret 'where' in 'before' case
For the 'before' part of the reply, make sure we use the where
from the correct Saw. Otherwise, for example, a public message
preceeding a quit would show a dangling 'in ' at the end of the reply.
The new Freenode ircd returns multiple RPL_WHOISCHANNELS lines (split
based on length), and they must be merged, otherwise only the last ends
up as the list of channels that the bot is in.
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
Giuseppe Bilotta [Mon, 25 Jan 2010 22:11:43 +0000 (23:11 +0100)]
markov: unify should_talk
Unify probability check for addressed and non-addressed case by
passing the message as a parameter to should_talk and picking the
probability accordingly.
Yaohan Chen [Mon, 30 Nov 2009 19:19:55 +0000 (14:19 -0500)]
Simplify support for using "auto" to detect source language
When "auto" is used as source language, Google Translate detects the
source language. However there is no need to hardcode Google Translate
as the only translator supporting "auto". If another translator supports
language detection, we can add "auto" to its supported source languages.
If no translator in default_list supports translating from "auto", the
existing code already responds with a message saying so.