Skip to content

Commit

Permalink
TW-2169 added avatar and name for sender messages in web
Browse files Browse the repository at this point in the history
  • Loading branch information
KhaledNjim committed Dec 8, 2024
1 parent f7c44a5 commit ba7a6e9
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
3 changes: 1 addition & 2 deletions lib/pages/chat/events/message/display_name_widget.dart
Original file line number Diff line number Diff line change
@@ -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';

Expand Down Expand Up @@ -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,
Expand Down
3 changes: 2 additions & 1 deletion lib/pages/chat/events/message/message.dart
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,8 @@ class _MessageState extends State<Message> {
return const SizedBox();
}

if (sameSender && !ownMessage) {
if (sameSender &&
(!ownMessage || !Message.responsiveUtils.isMobile(context))) {
return Padding(
padding: MessageStyle.paddingAvatar,
child: FutureBuilder<User?>(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 0 additions & 1 deletion lib/utils/matrix_sdk_extensions/event_extension.dart
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ extension LocalizedBody on Event {
}.contains(messageType);

bool hideDisplayName(Event? nextEvent) =>
isOwnMessage ||
room.isDirectChat ||
!isSameSenderWith(nextEvent) ||
type == EventTypes.Encrypted;
Expand Down

0 comments on commit ba7a6e9

Please sign in to comment.