Skip to content

Commit 3e8a094

Browse files
committed
msglist/emoji: Distinguish muted users in message list page and reactions
1 parent e77e29b commit 3e8a094

11 files changed

+41
-3
lines changed

assets/l10n/app_en.arb

+4
Original file line numberDiff line numberDiff line change
@@ -863,6 +863,10 @@
863863
"@revealButtonLabel": {
864864
"description": "Label for the button revealing hidden message from a muted sender in message list."
865865
},
866+
"mutedUser": "Muted user",
867+
"@mutedUser": {
868+
"description": "Name for a muted user to display all over the app."
869+
},
866870
"scrollToBottomTooltip": "Scroll to bottom",
867871
"@scrollToBottomTooltip": {
868872
"description": "Tooltip for button to scroll to bottom."

lib/generated/l10n/zulip_localizations.dart

+6
Original file line numberDiff line numberDiff line change
@@ -1263,6 +1263,12 @@ abstract class ZulipLocalizations {
12631263
/// **'Reveal message for muted sender'**
12641264
String get revealButtonLabel;
12651265

1266+
/// Name for a muted user to display all over the app.
1267+
///
1268+
/// In en, this message translates to:
1269+
/// **'Muted user'**
1270+
String get mutedUser;
1271+
12661272
/// Tooltip for button to scroll to bottom.
12671273
///
12681274
/// In en, this message translates to:

lib/generated/l10n/zulip_localizations_ar.dart

+3
Original file line numberDiff line numberDiff line change
@@ -673,6 +673,9 @@ class ZulipLocalizationsAr extends ZulipLocalizations {
673673
@override
674674
String get revealButtonLabel => 'Reveal message for muted sender';
675675

676+
@override
677+
String get mutedUser => 'Muted user';
678+
676679
@override
677680
String get scrollToBottomTooltip => 'Scroll to bottom';
678681

lib/generated/l10n/zulip_localizations_en.dart

+3
Original file line numberDiff line numberDiff line change
@@ -673,6 +673,9 @@ class ZulipLocalizationsEn extends ZulipLocalizations {
673673
@override
674674
String get revealButtonLabel => 'Reveal message for muted sender';
675675

676+
@override
677+
String get mutedUser => 'Muted user';
678+
676679
@override
677680
String get scrollToBottomTooltip => 'Scroll to bottom';
678681

lib/generated/l10n/zulip_localizations_ja.dart

+3
Original file line numberDiff line numberDiff line change
@@ -673,6 +673,9 @@ class ZulipLocalizationsJa extends ZulipLocalizations {
673673
@override
674674
String get revealButtonLabel => 'Reveal message for muted sender';
675675

676+
@override
677+
String get mutedUser => 'Muted user';
678+
676679
@override
677680
String get scrollToBottomTooltip => 'Scroll to bottom';
678681

lib/generated/l10n/zulip_localizations_nb.dart

+3
Original file line numberDiff line numberDiff line change
@@ -673,6 +673,9 @@ class ZulipLocalizationsNb extends ZulipLocalizations {
673673
@override
674674
String get revealButtonLabel => 'Reveal message for muted sender';
675675

676+
@override
677+
String get mutedUser => 'Muted user';
678+
676679
@override
677680
String get scrollToBottomTooltip => 'Scroll to bottom';
678681

lib/generated/l10n/zulip_localizations_pl.dart

+3
Original file line numberDiff line numberDiff line change
@@ -673,6 +673,9 @@ class ZulipLocalizationsPl extends ZulipLocalizations {
673673
@override
674674
String get revealButtonLabel => 'Reveal message for muted sender';
675675

676+
@override
677+
String get mutedUser => 'Muted user';
678+
676679
@override
677680
String get scrollToBottomTooltip => 'Przewiń do dołu';
678681

lib/generated/l10n/zulip_localizations_ru.dart

+3
Original file line numberDiff line numberDiff line change
@@ -673,6 +673,9 @@ class ZulipLocalizationsRu extends ZulipLocalizations {
673673
@override
674674
String get revealButtonLabel => 'Reveal message for muted sender';
675675

676+
@override
677+
String get mutedUser => 'Muted user';
678+
676679
@override
677680
String get scrollToBottomTooltip => 'Scroll to bottom';
678681

lib/generated/l10n/zulip_localizations_sk.dart

+3
Original file line numberDiff line numberDiff line change
@@ -673,6 +673,9 @@ class ZulipLocalizationsSk extends ZulipLocalizations {
673673
@override
674674
String get revealButtonLabel => 'Reveal message for muted sender';
675675

676+
@override
677+
String get mutedUser => 'Muted user';
678+
676679
@override
677680
String get scrollToBottomTooltip => 'Scroll to bottom';
678681

lib/widgets/emoji_reaction.dart

+3-1
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,9 @@ class ReactionChip extends StatelessWidget {
162162
? userIds.map((id) {
163163
return id == store.selfUserId
164164
? zulipLocalizations.reactedEmojiSelfUser
165-
: store.userDisplayName(id);
165+
: store.isUserMuted(id)
166+
? zulipLocalizations.mutedUser
167+
: store.userDisplayName(id);
166168
}).join(', ')
167169
: userIds.length.toString();
168170

lib/widgets/message_list.dart

+7-2
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,10 @@ class MessageListAppBarTitle extends StatelessWidget {
424424
if (otherRecipientIds.isEmpty) {
425425
return Text(zulipLocalizations.dmsWithYourselfPageTitle);
426426
} else {
427-
final names = otherRecipientIds.map(store.userDisplayName);
427+
final names = otherRecipientIds.map((id) =>
428+
store.isUserMuted(id)
429+
? zulipLocalizations.mutedUser
430+
: store.userDisplayName(id));
428431
// TODO show avatars
429432
return Text(
430433
zulipLocalizations.dmsWithOthersPageTitle(names.join(', ')));
@@ -1176,7 +1179,9 @@ class DmRecipientHeader extends StatelessWidget {
11761179
if (message.allRecipientIds.length > 1) {
11771180
title = zulipLocalizations.messageListGroupYouAndOthers(message.allRecipientIds
11781181
.where((id) => id != store.selfUserId)
1179-
.map(store.userDisplayName)
1182+
.map((id) => store.isUserMuted(id)
1183+
? zulipLocalizations.mutedUser
1184+
: store.userDisplayName(id))
11801185
.sorted()
11811186
.join(", "));
11821187
} else {

0 commit comments

Comments
 (0)