From a33a20af4c1dff06d1983cd60b7222696c4c0478 Mon Sep 17 00:00:00 2001 From: Sorunome Date: Sat, 24 Jul 2021 18:04:13 +0200 Subject: [PATCH] feat: Display the room name in room pills --- lib/widgets/event_content/html_message.dart | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/widgets/event_content/html_message.dart b/lib/widgets/event_content/html_message.dart index b2a5207f..07019e84 100644 --- a/lib/widgets/event_content/html_message.dart +++ b/lib/widgets/event_content/html_message.dart @@ -1,8 +1,10 @@ import 'package:matrix/matrix.dart'; import 'package:flutter_matrix_html/flutter_html.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_gen/gen_l10n/l10n.dart'; import '../../utils/url_launcher.dart'; import '../../config/setting_keys.dart'; +import '../../utils/matrix_sdk_extensions.dart/matrix_locals.dart'; import '../matrix.dart'; @@ -108,7 +110,8 @@ class HtmlMessage extends StatelessWidget { state.content['alt_aliases'].contains(identifier)))) { // we have a room! return { - 'displayname': identifier, + 'displayname': + r.getLocalizedDisplayname(MatrixLocals(L10n.of(context))), 'avatar_url': r.getState('m.room.avatar')?.content['url'], }; } @@ -122,7 +125,8 @@ class HtmlMessage extends StatelessWidget { return null; } return { - 'displayname': r.canonicalAlias, + 'displayname': + r.getLocalizedDisplayname(MatrixLocals(L10n.of(context))), 'avatar_url': r.getState('m.room.avatar')?.content['url'], }; }