From 7ec406f39d3ed9e8f10f2be02093de8d1e5d56b1 Mon Sep 17 00:00:00 2001 From: akshatdalton Date: Tue, 13 Jul 2021 07:37:57 +0000 Subject: [PATCH] refactor: Extract `RESOLVED_TOPIC_PREFIX` in topic.py. This is a prep commit for #18990. --- zerver/lib/actions.py | 4 +--- zerver/lib/topic.py | 3 +++ zerver/tests/test_message_edit.py | 3 +-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/zerver/lib/actions.py b/zerver/lib/actions.py index cea98cc32c..583d30a90e 100644 --- a/zerver/lib/actions.py +++ b/zerver/lib/actions.py @@ -158,6 +158,7 @@ from zerver.lib.timezone import canonicalize_timezone from zerver.lib.topic import ( LEGACY_PREV_TOPIC, ORIG_TOPIC, + RESOLVED_TOPIC_PREFIX, TOPIC_LINKS, TOPIC_NAME, filter_by_exact_message_topic, @@ -5697,9 +5698,6 @@ class MessageUpdateUserInfoResult(TypedDict): mention_user_ids: Set[int] -RESOLVED_TOPIC_PREFIX = "✔ " - - def maybe_send_resolve_topic_notifications( *, user_profile: UserProfile, diff --git a/zerver/lib/topic.py b/zerver/lib/topic.py index b0962f82b9..f30e927cb0 100644 --- a/zerver/lib/topic.py +++ b/zerver/lib/topic.py @@ -16,6 +16,9 @@ TOPIC_NAME = "subject" TOPIC_LINKS = "topic_links" MATCH_TOPIC = "match_subject" +# Prefix use to mark topic as resolved. +RESOLVED_TOPIC_PREFIX = "✔ " + # This constant is actually embedded into # the JSON data for message edit history, # so we'll always need to handle legacy data diff --git a/zerver/tests/test_message_edit.py b/zerver/tests/test_message_edit.py index bcf2b1f982..e0994edae9 100644 --- a/zerver/tests/test_message_edit.py +++ b/zerver/tests/test_message_edit.py @@ -9,7 +9,6 @@ from django.http import HttpResponse from django.utils.timezone import now as timezone_now from zerver.lib.actions import ( - RESOLVED_TOPIC_PREFIX, do_change_stream_post_policy, do_change_user_role, do_delete_messages, @@ -21,7 +20,7 @@ from zerver.lib.actions import ( from zerver.lib.message import MessageDict, has_message_access, messages_for_ids from zerver.lib.test_classes import ZulipTestCase from zerver.lib.test_helpers import cache_tries_captured, queries_captured -from zerver.lib.topic import LEGACY_PREV_TOPIC, TOPIC_NAME +from zerver.lib.topic import LEGACY_PREV_TOPIC, RESOLVED_TOPIC_PREFIX, TOPIC_NAME from zerver.models import Message, Realm, Stream, UserMessage, UserProfile, get_realm, get_stream