Skip to content

Commit 6e587cc

Browse files
committed
msglist: Exclude muted users from typing-status text
Following web: zulip#1429 (review)
1 parent eebd1ed commit 6e587cc

File tree

2 files changed

+22
-5
lines changed

2 files changed

+22
-5
lines changed

lib/widgets/message_list.dart

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1327,13 +1327,14 @@ class _TypingStatusWidgetState extends State<TypingStatusWidget> with PerAccount
13271327
final store = PerAccountStoreWidget.of(context);
13281328
final zulipLocalizations = ZulipLocalizations.of(context);
13291329
final typistIds = model!.typistIdsInNarrow(narrow);
1330-
if (typistIds.isEmpty) return const SizedBox();
1331-
final text = switch (typistIds.length) {
1330+
final filteredTypistIds = typistIds.whereNot(store.isUserMuted);
1331+
if (filteredTypistIds.isEmpty) return const SizedBox();
1332+
final text = switch (filteredTypistIds.length) {
13321333
1 => zulipLocalizations.onePersonTyping(
1333-
store.userDisplayName(typistIds.first)),
1334+
store.userDisplayName(filteredTypistIds.first)),
13341335
2 => zulipLocalizations.twoPeopleTyping(
1335-
store.userDisplayName(typistIds.first),
1336-
store.userDisplayName(typistIds.last)),
1336+
store.userDisplayName(filteredTypistIds.first),
1337+
store.userDisplayName(filteredTypistIds.last)),
13371338
_ => zulipLocalizations.manyPeopleTyping,
13381339
};
13391340

test/widgets/message_list_test.dart

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -893,6 +893,22 @@ void main() {
893893
// Wait for the pending timers to end.
894894
await tester.pump(const Duration(seconds: 15));
895895
});
896+
897+
testWidgets('muted user typing', (tester) async {
898+
await setupMessageListPage(tester,
899+
narrow: topicNarrow, users: users, messages: [streamMessage]);
900+
901+
await store.setMutedUsers([eg.otherUser.userId]);
902+
await tester.pump();
903+
904+
await checkTyping(tester,
905+
eg.typingEvent(topicNarrow, TypingOp.start, eg.thirdUser.userId),
906+
expected: 'Third User is typing…', // no "Other User"
907+
);
908+
909+
// Wait for the pending timers to end.
910+
await tester.pump(const Duration(seconds: 15));
911+
});
896912
});
897913

898914
group('MarkAsReadWidget', () {

0 commit comments

Comments
 (0)