@@ -2,6 +2,7 @@ import 'dart:async';
22
33import 'package:collection/collection.dart' ;
44import 'package:flutter/material.dart' ;
5+ import 'package:flutter/scheduler.dart' ;
56import 'package:flutter_color_models/flutter_color_models.dart' ;
67import 'package:intl/intl.dart' hide TextDirection;
78
@@ -772,8 +773,17 @@ class _MessageListState extends State<MessageList> with PerAccountStoreAwareStat
772773 }
773774
774775 void _initModel (PerAccountStore store, Anchor anchor) {
776+ // Normalize topic name if this is a TopicNarrow. See #1717.
777+ var narrow = widget.narrow;
778+ if (narrow is TopicNarrow ) {
779+ narrow = narrow.processTopicLikeServer (
780+ zulipFeatureLevel: store.zulipFeatureLevel,
781+ realmEmptyTopicDisplayName: store.zulipFeatureLevel > 334
782+ ? store.realmEmptyTopicDisplayName
783+ : null );
784+ }
775785 _model = MessageListView .init (store: store,
776- narrow: widget. narrow, anchor: anchor);
786+ narrow: narrow, anchor: anchor);
777787 model.addListener (_modelChanged);
778788 model.fetchInitial ();
779789 }
@@ -794,6 +804,7 @@ class _MessageListState extends State<MessageList> with PerAccountStoreAwareStat
794804
795805 if (model.narrow != widget.narrow) {
796806 // Either:
807+ // - We normalized the topic name in `_initModel` above.
797808 // - A message move event occurred, where propagate mode is
798809 // [PropagateMode.changeAll] or [PropagateMode.changeLater]. Or:
799810 // - We fetched a "with" / topic-permalink narrow, and the response
0 commit comments