The check for existing history files was performed outside of the lock, so multiple threads attempted to create them and failed. This lead to missing entries in the logs.
In case of bad command usage, throw an IllegalArgumentException.
IllegalArgumentException will be caught and handled specially. Whenever
IAE is thrown, it will be caught and command.help() will be called so
that we can receive additional usage instructions. The error and the
help information will be thrown inside a BadCommandInvocationException
which will be handled by the appropriate OperationSet.
In case of such an event, a system message will be fired with the usage
instructions as to inform the user on how to use the command. Other
exceptions will be logged as an error, as they are not expected and
considered to be an implementation issue.
* Moved from 'init' method to constructor.
* Expected format for the constructor described in the Command
interface comments.
* Distinguish between exceptions that occur during construction of the
command, log these and inform the user of an error; and exception
occurring during the execution of the command.
* Better error handling for commands.
To do:
* Add 'help' method to the Command interface.
* Catch IllegalArgumentException and automatically display help()
information to the user.
stack and connection.
This restructuring extracts all the methods that are related to an
established connection such that there is a better separation of
concerns between IRC stack state and the state for an individual
connection.
This way it is even possible to set null connection even before the
connection, its listeners, and its threads are completely disposed of.
This also fixes the bug with auto-join behaviour that occurs because of
multi-threading and bad (i.e. no) synchronization on the IRCApi
instance.
Modifications include the following:
- Updated otr4j which includes support for fragmentation of outgoing
messages. The modifications to otr4j to enable outgoing message
fragmentation includes breaking the API such that we are able to
return more than 1 message after it has been transformed.
(Corresponding modifications have been made to
AbstractOperationSetBasicInstantMessaging to facilitate the new API.)
- Fixed IRC implementation for OperationSetInstantMessageTransform.
- Modified AbstractOperationSetBasicInstantMessaging to handle multiple
Events returning from a call to messageTransform.
- Modified OperationSetBasicInstantMessaging implementations to
correspond to changes in AbstractOSBIM.
- OTR plugin has been modified to implement the newly added
getFragmenterInstructions method which is used to query instructions
on desired fragmentation behaviour.
- As a temporary solution, a hard dependency has been added to IRC
library such that I'm able to test fragmentation behaviour in a real
use case until an OperationSet is defined that can be used to query
for Instant Messaging transport parameters necessary to determine
appropriate fragmentation instructions.
A more advanced pattern that tries to take quotes into account. In case
this pattern does not work, this commit can be reverted and instead a
simpler pattern is used that relies on html tags being opened and closed
with < and > brackets. It assumes that < and > are always part of HTML
tags so any textual (content) occurrence should be replaced with html
entities (escaping).
Now escapes html entities during the parsing of the message received
from IRC and added a unit test for this requirement.
Renamed format* methods to styleAs*, since this is more appropriate.