Fix handling of MessageTags times when we are not at UTC.
MessageTags time is in UTC, LocalDateTime doesn't care for the timezone
when parsing, so we were treating the UTC time as the local time rather
then adjusting from UTC to Local.
Now we adjust it properly.
I incorrectly specified the timezone as UTC, when it needs to be
given the local timezone (so it can convert the always-in-UTC
epoch time into the correct local time).
Stop swimming against the tide and accept what most of the rest of
the world does.
While it adds an annoying depth to the actual source code, it makes
the root directory nicer (no more 'test-res' dirs), means we don't
have to override the gradle config, and makes it nicer to work in
IDEA 2016.1.
OutputQueue is now abstract, and the different queue methods
are subclasses.
This allows the same flexibility as before (subclasses can change
the type of items they add, implement their own throttling logic,
and say how the queue is ordered).
Organising it this way makes the package a lot easier to understand
as there's no longer a messy separation of concerns between
OutputQueue and QueueHandler (e.g. the output stream is no longer
in two places with two send methods, all of the definitions
relating to how the queue works are in one place, etc).
Add IRCDataInEvent that presents an IRCReader.ReadLine object rather than just the line of data.
This gives us access to MessageTags (#19) and pre-tokenised lines in DataIn rather than everything neededing to tokenise themselves.
There are probably a few other events we want to expose messagetags on that we still don't.
Try to keep track of channel keys (Close Issue #108)
- Parses outgoing JOINs to try and guess keys before we get the MODE reply.
- Parsing algorithm based on Quakenet/Hybrid handling of keys.
- Keys are swallowed from the key-list for EVERY channel that is
to join, even if it is not needed, so you would need to use
"JOIN #Foo,#Bar,#Baz Foo,,Baz" to join keyed channels #Foo and #Baz.
- Key changes by mode +k and -k will be tracked.
- Ignores attempts to set the key as "*" if we know a "better" key.
- Side effect: If the key is actually set to "*" we can only learn it if that
is what we join with, or it gets changed to that from no-key.
All callbacks are now done through getCallback, which offers
type safety (gasp!) and is potentially extensible in the future
(wow!).
This means that nothing can depend on callbacks existing, so
there are two functional changes:
- the parser will no longer disconnect automatically on failed
pings; users have to listen for the event and handle it
themselves;
- the parser will no longer attempt to automatically use alt
nicknames or create new nicknames on connection; users have to
listen for the event and implement the logic themselves
Both of these were really weird anyway, as adding a listener (even
for debugging purposes) disabled the built-in behaviour.
Add support for message tags from IRCv3 to IRCReader. Fixes #6
ReadLine now parses tags out of incoming lines (tags are not currently passed through the encoder)
IRCParser.tokeniseLine() now understands that tags may exist at the start of a line and tokenises accordingly.
(In reality, the only time it ever sees them is during testing)
Parser processLine now looks for timestamps from tags from the ReadLine, not by parsing token[0] itself.
Made IRCReader tests a lot less annoying to work with.
Make IRCParser extend the BSAP, and use that for creating new
sockets that respect bind IP/proxy settings.
Change-Id: I6d31b00552e9b65b8cece61de7ac94c3b099b8f4
Reviewed-on: http://gerrit.dmdirc.com/3973
Reviewed-by: Greg Holmes <greg@dmdirc.com>
Automatic-Compile: DMDirc Build Manager