Add replied message to replies (#189)

Add replies to chat
This commit is contained in:
Tommy Chow 2022-09-02 15:33:51 -04:00 • committed by GitHub
parent 71a3c8b7b9
commit f8358e71d3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 49 additions and 3 deletions

View file

@ -300,14 +300,17 @@ class IRCMessage {
// Add the colon separator between the username and their message to the span.
if (action == false) span.add(const TextSpan(text: ':'));
// Italicize the text it was called with an IRC Action i.e., "/me".
// Italicize the text if it was called with an IRC Action (e.g., "/me").
final textStyle = action == true ? const TextStyle(fontStyle: FontStyle.italic) : style;
if (!showMessage) {
span.add(const TextSpan(text: ' <message deleted>'));
} else {
// Check if the message is a reply. If it is, remove the reply username from the message.
final replyUser = tags['reply-parent-display-name'];
final words = replyUser == null ? split : split?.sublist(1);
// Add the message and any emotes to the span.
final words = split;
if (words != null) {
if (useZeroWidth) {
// Keep a local span which will be reversed and added to the final span.