Skip to content

Commit

Permalink
Make topic headers case-insensitive
Browse files Browse the repository at this point in the history
Topics in Zulip are case-insensitive. This change makes the message list's topic headers match that behavior, so messages whose topics differ only in case (like "missing string" and "Missing string") share a single header.  This brings the behavior in line with Zulip web.

### What is the change?

The change modifies the topic comparison logic in `haveSameRecipient()` to use case-insensitive comparison when determining whether to show a new recipient header.

Fixes #739
  • Loading branch information
shivanshsharma13 committed Dec 5, 2024
1 parent fb6291f commit a474a94
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/model/message_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ mixin _MessageSequence {
bool haveSameRecipient(Message prevMessage, Message message) {
if (prevMessage is StreamMessage && message is StreamMessage) {
if (prevMessage.streamId != message.streamId) return false;
if (prevMessage.topic != message.topic) return false;
if (prevMessage.topic.toLowerCase() != message.topic.toLowerCase()) return false;
} else if (prevMessage is DmMessage && message is DmMessage) {
if (!_equalIdSequences(prevMessage.allRecipientIds, message.allRecipientIds)) {
return false;
Expand Down

0 comments on commit a474a94

Please sign in to comment.