Age | Commit message (Collapse) | Author |
|
|
|
|
|
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.)
|
|
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.
|
|
For consistency, all delegations now return the actual Channel object in
data[:channel] and the actual User object in data[:nick].
|
|
Delete the corresponding user/channel from the server list (if present),
and notify the client about the error.
|
|
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.
|
|
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).
|
|
|
|
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.
|
|
|
|
|
|
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.
|
|
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}.
|
|
|
|
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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"
|
|
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.
|
|
|
|
prevent errors when dumping users
|
|
|
|
|
|
|
|
|
|
|
|
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.
|
|
instead of setting it
|
|
some networks allow it
|
|
|
|
|
|
|
|
|
|
|
|
from template
|
|
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.
|
|
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.
|
|
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.
|
|
this allows shell plugin to capture replies of a command even if this command is
run because of a fake message
|
|
|
|
|
|
|
|
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.
|