@@ -664,6 +664,11 @@ enum MessageFlag {
664
664
// Using as a Map key is almost certainly a bug because it won't case-fold;
665
665
// see for example #739, #980, #1205.
666
666
extension type const TopicName (String _value) {
667
+ /// The canonical form of the resolved-topic prefix.
668
+ // This is RESOLVED_TOPIC_PREFIX in web:
669
+ // https://github.com/zulip/zulip/blob/1fac99733/web/shared/src/resolved_topic.ts
670
+ static const resolvedTopicPrefix = '✔ ' ;
671
+
667
672
/// The string this topic is identified by in the Zulip API.
668
673
///
669
674
/// This should be used in constructing HTTP requests to the server,
@@ -844,25 +849,20 @@ enum MessageEditState {
844
849
edited,
845
850
moved;
846
851
847
- // Adapted from the shared code:
848
- // https://github.com/zulip/zulip/blob/1fac99733/web/shared/src/resolved_topic.ts
849
- // The canonical resolved-topic prefix.
850
- static const String _resolvedTopicPrefix = '✔ ' ;
851
-
852
852
/// Whether the given topic move reflected either a "resolve topic"
853
853
/// or "unresolve topic" operation.
854
854
///
855
855
/// The Zulip "resolved topics" feature is implemented by renaming the topic;
856
856
/// but for purposes of [Message.editState] , we want to ignore such renames.
857
857
/// This method identifies topic moves that should be ignored in that context.
858
858
static bool topicMoveWasResolveOrUnresolve (TopicName topic, TopicName prevTopic) {
859
- if (topic.apiName.startsWith (_resolvedTopicPrefix )
860
- && topic.apiName.substring (_resolvedTopicPrefix .length) == prevTopic.apiName) {
859
+ if (topic.apiName.startsWith (TopicName .resolvedTopicPrefix )
860
+ && topic.apiName.substring (TopicName .resolvedTopicPrefix .length) == prevTopic.apiName) {
861
861
return true ;
862
862
}
863
863
864
- if (prevTopic.apiName.startsWith (_resolvedTopicPrefix )
865
- && prevTopic.apiName.substring (_resolvedTopicPrefix .length) == topic.apiName) {
864
+ if (prevTopic.apiName.startsWith (TopicName .resolvedTopicPrefix )
865
+ && prevTopic.apiName.substring (TopicName .resolvedTopicPrefix .length) == topic.apiName) {
866
866
return true ;
867
867
}
868
868
0 commit comments