Commit 4320394e authored by Wilko Manger's avatar Wilko Manger

Render emote messages correctly in chat overview

parent 1524eba6
......@@ -62,9 +62,9 @@ abstract class Subtitle extends StatelessWidget {
color: Theme.of(context).textTheme.caption.color
);
TextSpan senderSpan(BuildContext context) =>
TextSpan senderSpan(BuildContext context, {String sender}) =>
TextSpan(
text: senderName,
text: sender ?? senderName,
style: Theme.of(context).textTheme.body1.copyWith(
fontWeight: FontWeight.bold,
color: Theme.of(context).textTheme.caption.color
......
......@@ -17,6 +17,7 @@
import 'package:flutter/material.dart';
import 'package:matrix_sdk/matrix_sdk.dart';
import 'package:pattle/src/ui/util/user.dart';
import 'subtitle.dart';
......@@ -29,6 +30,10 @@ class TextSubtitle extends Subtitle {
@override
Widget build(BuildContext context) {
final sender = senderSpan(context,
sender: event is EmoteMessageEvent
? displayNameOf(event.sender) + ' ' : null
);
if (event.content.inReplyToId == null) {
return RichText(
overflow: TextOverflow.ellipsis,
......@@ -36,7 +41,7 @@ class TextSubtitle extends Subtitle {
text: TextSpan(
style: textStyle(context),
children: [
senderSpan(context),
sender,
TextSpan(
text: event.content.body ?? 'null'
)
......@@ -53,7 +58,7 @@ class TextSubtitle extends Subtitle {
RichText(
overflow: TextOverflow.ellipsis,
maxLines: 1,
text: senderSpan(context)
text: sender
),
Icon(
Icons.reply,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment