Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
markdown: Refactor classes handling stream topic links.
Kislay Udbhav Verma65c9b249b7b7
diff --git a/zerver/lib/markdown/__init__.py b/zerver/lib/markdown/__init__.pyindex 74962206f88..f004d7035fa 100644--- a/zerver/lib/markdown/__init__.py+++ b/zerver/lib/markdown/__init__.py@@ -1984,7 +1984,7 @@ class UserGroupMentionPattern(CompiledInlineProcessor):return None, None, None-class StreamPattern(CompiledInlineProcessor):+class StreamTopicMessageProcessor(CompiledInlineProcessor):def find_stream_id(self, name: str) -> int | None:db_data: DbData | None = self.zmd.zulip_db_dataif db_data is None:@@ -1992,6 +1992,8 @@ class StreamPattern(CompiledInlineProcessor):stream_id = db_data.stream_names.get(name)return stream_id++class StreamPattern(StreamTopicMessageProcessor):@overridedef handleMatch( # type: ignore[override] # https://github.com/python/mypy/issues/10197self, m: Match[str], data: str@@ -2016,14 +2018,7 @@ class StreamPattern(CompiledInlineProcessor):return el, m.start(), m.end()-class StreamTopicPattern(CompiledInlineProcessor):- def find_stream_id(self, name: str) -> int | None:- db_data: DbData | None = self.zmd.zulip_db_data- if db_data is None:- return None- stream_id = db_data.stream_names.get(name)- return stream_id-+class StreamTopicPattern(StreamTopicMessageProcessor):@overridedef handleMatch( # type: ignore[override] # https://github.com/python/mypy/issues/10197self, m: Match[str], data: str