summaryrefslogtreecommitdiff
path: root/lib/rbot
AgeCommit message (Collapse)Author
2008-08-19IRC Socket: documentation cleanupGiuseppe Bilotta
2008-08-19IRC socket: minor flood_send logic fixesGiuseppe Bilotta
2008-08-19IRC socket: get rid of delay/burstGiuseppe Bilotta
The penalty system should be enough to prevent the bot from being disconnected because of excess flood, making the old sendq delay/burst code unnecessary. So get rid of the latter altogether. (If the penalty system as implemented ever happens to be insufficient as implemented, it should just get fixed rather than rely on the sendq delay/burst assistance.)
2008-08-13message.rb: fix message addressing logicGiuseppe Bilotta
IRC messages which are not PRIVMSG or NOTICE (i.e. not UserMessage) are 'addressed' to the bot when they originate from it. Rather than putting this logic in each one of them (and forgetting about it for some, e.g. NICK messages), put it in BasicUserMessage. Compensate by always setting @address in UserMessage to test against target instead.
2008-08-11rfc2812: always return the actual Channel or User when handledGiuseppe Bilotta
For consistency, all delegations now return the actual Channel object in data[:channel] and the actual User object in data[:nick].
2008-08-11rfc2812: handle ERR_NOSUCHNICK and ERR_NOSUCHCHANNELGiuseppe Bilotta
Delete the corresponding user/channel from the server list (if present), and notify the client about the error.
2008-08-11rfc2812: create channels and users for al commands when neededGiuseppe Bilotta
Always create a user or channel when we receive information about it. This makes server message parsing much more robust (no more crashes about NilClass not having user/channel methods) but has a few subtle implications about the server state: for example, channels may exist in the Server object even when the bot is not in the channel itself.
2008-08-10irclog core module: rename old logs when switching from dir to fileGiuseppe Bilotta
It may happen that a user changes from an irclog.filename_format where some components are files to a format where they are directories (e.g. from '%%{where}' to '%%{where}/%Y') or conversely. In this case, we rename the existing file/dir by appending '.old.atime' to it (atime is the actual file/dir access time).
2008-08-10irclog core module: skip, don't die when unable to open logfileGiuseppe Bilotta
2008-08-10+ handle WHOIS queriesGiuseppe Bilotta
The bot now exposes a whois(nick) method to make WHOIS queries to the server. The extended syntax whois(nick, server) is also supported, allowing another server to be queried (this is useful to retrieve info which is only available on nick's server, such as idle time and signon date). Most if not all RFC-compliant replies are handled, although some of the data received is currently ignored. Non-RFC extended replies such as nickserv identification status are not hanlded yet, since they are highly server-specific, both in numeric reply choice (e.g. 307 vs 320) and in reply message syntax and meaning. A new WhoisMessage is also introduced, for plugin delegation. The source is the originating server, the target is the user for which information was requested. A #whois() method is provided holding all retrieved information.
2008-08-10rfc2812.rb: support RPL_AWAY replyGiuseppe Bilotta
2008-08-09+ support channel URL and creation timeGiuseppe Bilotta
2008-08-09message.rb: correct @plainmessage and @message for CTCP messagesGiuseppe Bilotta
After CTCP parsing, @plainmessage was not defined correctly (as it still contained the CTCP command), and @plainmessage and @message were not being cleaned up correctly. This manifested itself e.g. with spurious \001ACTION and other strange unusual byte sequence popping up in markov-generated text. Fix by redefining @plainmessage and @message appropriately in CTCP handling.
2008-08-08irclog core module: double-percent the {where} in irclog.filename_formatGiuseppe Bilotta
strftime in Ruby versions before 1.8.7 gobbles % which are not part of a known format directives, so %{where} must be double-escaped into %%{where}.
2008-08-08plugins.rb: use IO.read instead of readlins+join gimmicksGiuseppe Bilotta
2008-08-06basics: option to join channel after identification is confirmedGiuseppe Bilotta
Sometimes it is necessary to wait for identification to be confirmed before certain channels may be joined. In this case the option irc.join_after_identify can be set to true, and the bot will wait for nickserv to confirm the identification before joining any channels. This solution is actually a rather ugly hack, but I can't think of a better way to approach the problem without rewriting the whole framework.
2008-08-05irclog core module: log rotationGiuseppe Bilotta
2008-08-03* fix ominous bug in Regexp::IP_ADDRGiuseppe Bilotta
2008-07-31+ core/config: sort config search resultdmitry kim
2008-07-30message.rb: fix a thinko in inspect()Giuseppe Bilotta
2008-07-30+ @bot.wanted_nick stores the nick wanted by the botGiuseppe Bilotta
2008-07-30* nick is handled by config, not basicsGiuseppe Bilotta
2008-07-30ircbot.rb: server no-color modes can be configuredGiuseppe Bilotta
2008-07-29auth core botmodule: advertise and act on mismatched master passwordGiuseppe Bilotta
2008-07-16Revert "* use to_irc_netmask(:force => true) to unlink Netmasks from their ↵Giuseppe Bilotta
Server to prevent errors when dumping users" This reverts commit 9a1cf6a11b12c06cd925dd6a789ec98fe750c8ad, since it was a hack to work around the undumpable Channel (and consequently Server and Netmask) caused by 847a977b228b35f5ab281a31dd3724a4db887dff "#any? and #all? methods for Channel#mode to check if modes are set" and fixed by 8f8205310518e7b0626d657ba9667f7bfc745371 "Dumpable definition of #any? and #all? methods for Channel#mode"
2008-07-16Dumpable definition of #any? and #all? methods for Channel#modeGiuseppe Bilotta
Commit 847a977b228b35f5ab281a31dd3724a4db887dff "#any? and #all? methods for Channel#mode to check if modes are set" turned Channel into a non-marshallable object because of singleton methods. Revert the commit and define an ad-hoc ModeHash class with the any? and all? methods, to make Channel#mode of that class.
2008-07-14plugins.rb: commands were being delegated even from ignored messagesGiuseppe Bilotta
2008-07-14* use to_irc_netmask(:force => true) to unlink Netmasks from their Server to ↵Giuseppe Bilotta
prevent errors when dumping users
2008-07-11do not crash when GetText.cached= is not definedYaohan Chen
2008-07-07httputil: don't fail when b0rked servers put the charset in the content-encodingGiuseppe Bilotta
2008-07-03utils.rb: added timeago and distance_of_time_in_words functionsCasey Link
2008-07-01Version 0.9.11-rc1Giuseppe Bilotta
2008-06-29message.rb: suppress warning about duplicate methodGiuseppe Bilotta
2008-06-29* fix handling of IDENTIFY_MSGGiuseppe Bilotta
When a server has IDENTIFY-MSG, we would expect identification in any PRIVMSG or NOTICE, even on those generated from the bot. This caused lots of spurious warnings, and would lead to mislogging when a bot-generated message started with + or -. Fix this by only handling IDENTIFY-MSG on server-generated messages.
2008-06-28ircbot.rb: @bot.topic() can also be used to retrieve topic information ↵Giuseppe Bilotta
instead of setting it
2008-06-28New IRC framework: allow RPL_TOPIC(_INFO) for channels we are not on, since ↵Giuseppe Bilotta
some networks allow it
2008-06-26ircbot.rb: make #mode()'s third argument optionalGiuseppe Bilotta
2008-06-26config.rb: localize git date in versionGiuseppe Bilotta
2008-06-26message.rb: saner \#inspect() for BasicUserMessage and derivativesGiuseppe Bilotta
2008-06-24allow multi-line (artificial) messages be delegated and handledYaohan Chen
2008-06-24extends.rb: suppress warningGiuseppe Bilotta
2008-06-24ircbot.rb: create the appropriate directories when updating botclass dir ↵Giuseppe Bilotta
from template
2008-06-24message handling: improve IRC format handling for received messagesGiuseppe Bilotta
Rather than stripping colors all around and keeping other format codes, we only strip initial and final formatting before parsing the message. We store the original, unstripped message in #logmessage() and a fully stripped copy of the message in #plainmessage() This means that most plugins will now have full formatting of arguments preserved, while stupid IRC usage of formatting whole lines will not interfere with bot usage. Plugins that need a fully stripped version of the message can still access it.
2008-06-24ircsocket.rb: use syswrite since ruby's buffered io is racyGiuseppe Bilotta
In some situations a PRIVMSG could be output twice in sequence with no intervening newline when using the Socket#puts function. Use syswrite to skip Ruby's buffered IO.
2008-06-24fake_message duplicates m.reply and m.in_thread from the :from messageYaohan Chen
this makes it possible to create a fake message, override its reply method in order to get its "return value", even if the fake message will be handled by creating another fake message.
2008-06-24fake messages will use the originating message's reply methodYaohan Chen
this allows shell plugin to capture replies of a command even if this command is run because of a fake message
2008-06-24ircbot.rb: copy missing template files on startupGiuseppe Bilotta
2008-06-24config.rb: system wide overrides in /etc/rbot.confGiuseppe Bilotta
2008-06-23Set GetText.cached = false so that mo files are reloaded when setting localeYaohan Chen
2008-06-23rfc2812.rb: skip unknown channel modes altogetherGiuseppe Bilotta
Some servers set non-advertized channel modes. Since we cannot handle them (as we don't know what type they are) and setting them crashes the bot, we remove them.