fix: Sendername prefix

This commit is contained in:
Christian Pauly 2020-11-22 16:35:16 +01:00
parent 418a4e2397
commit 8aaff6fbbe
1 changed files with 4 additions and 3 deletions

View File

@ -132,6 +132,8 @@ class ChatListItem extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
final isMuted = room.pushRuleState != PushRuleState.notify; final isMuted = room.pushRuleState != PushRuleState.notify;
final typingText = room.getLocalizedTypingText(context); final typingText = room.getLocalizedTypingText(context);
final ownMessage =
room.lastEvent?.senderId == Matrix.of(context).client.userID;
return Center( return Center(
child: Material( child: Material(
color: chatListItemColor(context, activeChat, selected), color: chatListItemColor(context, activeChat, selected),
@ -196,9 +198,7 @@ class ChatListItem extends StatelessWidget {
subtitle: Row( subtitle: Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
if (room.typingUsers.isEmpty && if (room.typingUsers.isEmpty && ownMessage) ...{
room.lastEvent?.senderId ==
Matrix.of(context).client.userID) ...{
Icon( Icon(
room.lastEvent.statusIcon, room.lastEvent.statusIcon,
size: 14, size: 14,
@ -225,6 +225,7 @@ class ChatListItem extends StatelessWidget {
: Text( : Text(
room.lastEvent?.getLocalizedBody( room.lastEvent?.getLocalizedBody(
MatrixLocals(L10n.of(context)), MatrixLocals(L10n.of(context)),
withSenderNamePrefix: !ownMessage,
hideReply: true, hideReply: true,
) ?? ) ??
'', '',