IRC Client Library 3.0.0 released!
31 Dec 2016Version 3.0.0 of the Kitteh IRC Client Library has been released!
As this is a major update, there's a lot to discuss. I'm breaking it down into non-breaking and breaking changes, with headings under each for changes worth talking more about.
Non-breaking Changes
- SNI support - Server hostname is now sent to the server for TLS connections.
- Updated to use latest Netty (4.1.6).
ServerMessage
is now accessible inClientReceiveServerMessageEvent
andKittehServerMessageException
- Added
Client.Builder#queryChannelInformation()
to allow disabling automaticWHO
queries. - The version of KICL in use is now available via
Version.getVersion()
. - KICL version is now included in the default realname.
- Current realname default is "KICL 3.0.0 - kitteh.org".
- Reduced chance of lost messages during reconnect.
- The client, rather than the connection, holds the sending queues.
- Provided events provide useful
toString()
.
STS Support
Strict Transport Security is a mechanism that lets servers specify to clients to only connect securely. Support for the draft IRCv3 specification for STS has been added. The documentation covers using STS in detail.
Customizable Default Messages
It is now possible to define the messages sent by default in the following situations:
- Client automatically reconnecting due to STS.
- Client automatically reconnecting due to ping timeout.
- Client automatically reconnecting due to IO exception.
- Client automatically disconnecting due to STS and inability to connect securely.
- Disconnecting without specifying a quit reason.
- Kicking a target without specifying a kick reason.
- Leaving a channel without specifying a part reason.
The DefaultMessageMap
allows you to specify, for each DefaultMessageType
, the
default message to use in the above scenarios. A default implementation is provided
and is used automatically, though you can implement DefaultMessageMap
yourself.
Perhaps you want the reconnection message to be dynamic. Now you can do this.
Breaking Changes
All sections below, including separate headings, include some breaking changes.
- Created
.commands()
methods inClient
andChannel
.- Provides
Command
s for various... commands. - Some methods in
Channel
are moved here. - This is the start of a full migration of commands into this method.
- Provides
- The channel adding methods in
Client
now consistently reject channel names perceived as invalid. - The channel removal reason and quit reason methods now accept null.
- This is because you can now have non-null defaults for these, per above customizable defaults.
RequestedChannelLeaveEvent
renamed toUnexpectedChannelLeaveEvent
.- This better reflects that this event is for when you've left a channel despite never calling a method to remove yourself from it.
- The two subclasses have been renamed to reflect this as well.
- The
Change
class, used in events, has migrated to theutil
package. - The
Replyable
helper has been accurately renamed toReplyableEvent
. RequestedChannelJoinCompleteEvent
moved to theevent.channel
package.UnexpectedChannelLeaveEvent
moved to theevent.helper
package.
A change to shading / relocating
KICL's libraries (MBassador, Netty) have been, until this point, shaded and relocated in the distributed jar file. This is no longer the default. Instead, the default jar you acquire by the groupId and artifactId does not have either shaded, and the compiled classes in that jar do not expect the library classes to be relocated. Instead, you must include these libraries yourself.
However, if you wish to continue using a pre-shaded, pre-relocated jar file you can acquire it
with the maven classifier conveniently named shaded
.
Account / Nickname / Username Naming Consistency
Previously, the words 'account', 'nickname', and 'username' had been overlapping in meaning. Account is now exclusively used to refer to a registered account with the server.
- Many parameter names updated to match this change.
AbstractUserPassProtocol
is nowAbstractAccountPassProtocol
.Username
(auth element class) is nowAccount
.
Flexible Message Delay
Message delay handling has been completely rewritten. The methods for setting a numeric delay are no longer present because that is no longer the only way to affect messages sent by the client.
You can now define what is effectively a supplier of MessageSendingQueue
, a new
class that takes messages in and sends them to a consumer when it chooses, via a
function that takes in the Client
currently in use. This can be done in the builder,
and can be updated at any point via a method on Client
which will cause an immediate
change in actively used MessageSendingQueue
.
Two implementations are provided:
QueueProcessingThreadSender
:- Processes messages FIFO via
QueueProcessingThread
, with a default-emptycheckReady
method which allows for delaying in this method in subclasses. - Using this class, you could have a zero delay
- Processes messages FIFO via
SingleDelaySender
:- A subclass of the above class, that waits a specified number of milliseconds between sends.
SingleDelaySender.getSupplier(int)
provides convenience.- This, with a default of 1200 ms, is used by default.