mirror of
https://github.com/zulip/zulip.git
synced 2025-11-05 14:35:27 +00:00
topic -> subject: Extract get_topic_from_message_info().
This changes files where it's safe to just assume caller may use either "topic" or "subject", and we prefer "topic" but support "subject".
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import urllib
|
||||
from typing import Any, Dict, List
|
||||
|
||||
from zerver.lib.topic import get_topic_from_message_info
|
||||
from zerver.models import Realm, Stream, UserProfile
|
||||
|
||||
def hash_util_encode(string: str) -> str:
|
||||
@@ -57,7 +58,7 @@ def near_stream_message_url(realm: Realm,
|
||||
message_id = str(message['id'])
|
||||
stream_id = message['stream_id']
|
||||
stream_name = message['display_recipient']
|
||||
topic_name = message['subject']
|
||||
topic_name = get_topic_from_message_info(message)
|
||||
encoded_topic = hash_util_encode(topic_name)
|
||||
encoded_stream = encode_stream(stream_id=stream_id, stream_name=stream_name)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user