From ba7a6e9ca575204eba81e87b2b89e1f6b9cafaf0 Mon Sep 17 00:00:00 2001 From: "khaled.njim" Date: Sun, 8 Dec 2024 23:25:45 +0100 Subject: [PATCH] TW-2169 added avatar and name for sender messages in web --- lib/pages/chat/events/message/display_name_widget.dart | 3 +-- lib/pages/chat/events/message/message.dart | 3 ++- .../events/message/message_content_with_timestamp_builder.dart | 3 +-- lib/utils/matrix_sdk_extensions/event_extension.dart | 1 - 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/pages/chat/events/message/display_name_widget.dart b/lib/pages/chat/events/message/display_name_widget.dart index 21ad559d8c..37436ca501 100644 --- a/lib/pages/chat/events/message/display_name_widget.dart +++ b/lib/pages/chat/events/message/display_name_widget.dart @@ -1,7 +1,6 @@ import 'package:fluffychat/pages/chat/events/message/message_style.dart'; import 'package:fluffychat/utils/string_extension.dart'; import 'package:flutter/material.dart'; -import 'package:google_fonts/google_fonts.dart'; import 'package:linagora_design_flutter/linagora_design_flutter.dart'; import 'package:matrix/matrix.dart'; @@ -29,7 +28,7 @@ class DisplayNameWidget extends StatelessWidget { maxCharacters: maxCharactersDisplayNameBubble, ), style: Theme.of(context).textTheme.labelMedium?.copyWith( - fontFamily: GoogleFonts.inter().fontFamily, + fontFamily: 'Inter', color: LinagoraSysColors.material().secondary, ), maxLines: 2, diff --git a/lib/pages/chat/events/message/message.dart b/lib/pages/chat/events/message/message.dart index 1edf72aa60..fcbf828d66 100644 --- a/lib/pages/chat/events/message/message.dart +++ b/lib/pages/chat/events/message/message.dart @@ -316,7 +316,8 @@ class _MessageState extends State { return const SizedBox(); } - if (sameSender && !ownMessage) { + if (sameSender && + (!ownMessage || !Message.responsiveUtils.isMobile(context))) { return Padding( padding: MessageStyle.paddingAvatar, child: FutureBuilder( diff --git a/lib/pages/chat/events/message/message_content_with_timestamp_builder.dart b/lib/pages/chat/events/message/message_content_with_timestamp_builder.dart index 7bd8a288c4..b5b403f23f 100644 --- a/lib/pages/chat/events/message/message_content_with_timestamp_builder.dart +++ b/lib/pages/chat/events/message/message_content_with_timestamp_builder.dart @@ -138,8 +138,7 @@ class MessageContentWithTimestampBuilder extends StatelessWidget { Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - event.hideDisplayName(nextEvent) || - event.hideDisplayNameInBubbleChat + event.hideDisplayName(nextEvent) ? const SizedBox() : DisplayNameWidget( event: event, diff --git a/lib/utils/matrix_sdk_extensions/event_extension.dart b/lib/utils/matrix_sdk_extensions/event_extension.dart index 2102cd33a1..f0a31a54ac 100644 --- a/lib/utils/matrix_sdk_extensions/event_extension.dart +++ b/lib/utils/matrix_sdk_extensions/event_extension.dart @@ -177,7 +177,6 @@ extension LocalizedBody on Event { }.contains(messageType); bool hideDisplayName(Event? nextEvent) => - isOwnMessage || room.isDirectChat || !isSameSenderWith(nextEvent) || type == EventTypes.Encrypted;