feat: use the stripped body for notifications and room previews

This commit is contained in:
Sorunome 2021-08-22 17:51:58 +02:00
parent f770fba962
commit cf74c231bb
No known key found for this signature in database
GPG Key ID: B19471D07FC9BE9C
2 changed files with 2 additions and 11 deletions

View File

@ -595,12 +595,7 @@ class BackgroundPush {
final title = l10n.unreadMessages(room.notificationCount);
// Calculate the body
final body = event?.getLocalizedBody(
MatrixLocals(l10n),
withSenderNamePrefix: true,
hideReply: true,
) ??
l10n.openAppToReadMessages;
final body = event?.plaintextBody ?? l10n.openAppToReadMessages;
// The person object for the android message style notification
final avatar = room.avatar == null

View File

@ -268,11 +268,7 @@ class ChatListItem extends StatelessWidget {
: Text(
room.membership == Membership.invite
? L10n.of(context).youAreInvitedToThisChat
: room.lastEvent?.getLocalizedBody(
MatrixLocals(L10n.of(context)),
hideReply: true,
) ??
'',
: room.lastEvent?.plaintextBody,
softWrap: false,
maxLines: 1,
overflow: TextOverflow.ellipsis,