You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- New features for the TranscriptWindow and TranscriptWindowInterceptors:
- Enable TranscriptWindowInterceptors to apply different background/foreground colors - and more generally different styles - to different parts of a message text displayed in the TranscriptWindow, using the syntax of Asciidoc Custom Inline Styles ( https://docs.asciidoctor.org/asciidoc/latest/text/custom-inline-styles/ ), i.e. '[.style-name]#my styled text#' will apply the style 'style-name' to the text between ''#' characters.
- Enable TranscriptWindowInterceptors to intercept messages that were added to a chat before the user joined the chat.
- Fixed the issue in chatrooms that if the message is coming from the chat server (e.g. the server rejected the message for security reasons) and not a room occupant, an exception is thrown and the message is not displayed in chat window.
* * <p>{@code [.style-name]#my styled text#} will have the effect of applying the style corresponding to {@code style-name} in {@code customStyles} parameter, to the text between {@code #} characters.
135
+
*
136
+
* @param timestamp The timestamp of the entry (cannot be null).
137
+
* @param isDelayed Set true if entry contain delayed delivery, historic timestamp.
138
+
* @param prefix The prefix of the message (typically, the name of the author of the message.
139
+
* @param prefixColor The color to be used for the timestamp and prefix text.
140
+
* @param message The message text itself.
141
+
* @param messageColor The color to be used for the message text.
142
+
* @param customStyles custom styles to be applied to specific parts of the message in the same manner as Asciidoc custom inline styles.
If the matched directive char is [, check whether this is '[.style-name]#sometext#', where style-name is one of the names in customStyles, in which case apply that custom inline style (Asciidoc-like)
228
+
*/
229
+
finalAttributeSetfragmentSpecificStyle;
230
+
if(directive == '[') {
231
+
if(line.charAt(from+1) == '.') {
232
+
// style-name is at least one character, therefore look for ] from 'from+3' position
233
+
finalintclosingSquareBracketIndex = line.indexOf(']', from + 3);
Log.debug("Applying custom inline style '" + appliedStyleName + "' to the text between #");
244
+
}
245
+
} else {
246
+
fragmentSpecificStyle = null;
247
+
}
248
+
} else {
249
+
fragmentSpecificStyle = null;
250
+
}
251
+
} elseif(directive == '#') {
252
+
/*
253
+
If the matched directive char is #, highlight (in yellow) the text between # (no custom inline style here, as it was already handled in previous case above).
for ( TranscriptWindowInterceptorinterceptor : SparkManager.getChatManager().getTranscriptWindowInterceptors() )
342
+
{
343
+
try
344
+
{
345
+
booleanhandled = interceptor.isHistoryMessageIntercepted( this, userid, message, date );
346
+
if ( handled )
347
+
{
348
+
// Do nothing.
349
+
return;
350
+
}
351
+
}
352
+
catch ( Exceptione )
353
+
{
354
+
Log.error( "A TranscriptWindowInterceptor ('" + interceptor + "') threw an exception while processing a chat history message (current user: '" + userid + "').", e );
* Adds a historic text message to this transcript window. These typically are messages that were added to a chat before the local user joined the chat.
* Adds a tagged historic text message to this transcript window. This is the same as {@link #insertHistoryMessage(String, Message, Date)}, except custom style(s) can be applied to specific part(s) of the message using Asciidoc-like
* <p>{@code [.style-name]#my styled text#} will have the effect of applying the style corresponding to {@code style-name} in {@code customStyles} parameter, to the text between {@code #} characters.
380
+
*
381
+
* @param userid the userid of the sender.
382
+
* @param message the message to insert.
383
+
* @param date the timestamp of the message.
384
+
* @param customStyles custom styles to be applied to the parts of the message between {@code #} and following {@code [.style-name]} where {@code style-name} is the key identifying the style attributes in this parameter.
0 commit comments