message_cache: Rename update_to_dict_cache to update_message_cache.

This better describes what it does.
This commit is contained in:
Alex Vandiver 2023-10-12 16:24:19 +00:00
parent 93a071a1f8
commit 96119e45b9
3 changed files with 6 additions and 6 deletions

View File

@ -40,7 +40,7 @@ from zerver.lib.message import (
topic_wildcard_mention_allowed,
truncate_topic,
)
from zerver.lib.message_cache import update_to_dict_cache
from zerver.lib.message_cache import update_message_cache
from zerver.lib.queue import queue_json_publish
from zerver.lib.stream_subscription import get_active_subscriptions_for_stream_id
from zerver.lib.stream_topic import StreamTopicTarget
@ -353,7 +353,7 @@ def do_update_embedded_data(
message.save(update_fields=["content", "rendered_content"])
event["message_ids"] = update_to_dict_cache(changed_messages)
event["message_ids"] = update_message_cache(changed_messages)
def user_info(um: UserMessage) -> Dict[str, Any]:
return {
@ -758,7 +758,7 @@ def do_update_message(
if stream_being_edited is not None:
realm_id = stream_being_edited.realm_id
event["message_ids"] = update_to_dict_cache(changed_messages, realm_id)
event["message_ids"] = update_message_cache(changed_messages, realm_id)
def user_info(um: UserMessage) -> Dict[str, Any]:
return {

View File

@ -10,7 +10,7 @@ from zerver.lib.message import (
should_change_visibility_policy,
visibility_policy_for_participation,
)
from zerver.lib.message_cache import update_to_dict_cache
from zerver.lib.message_cache import update_message_cache
from zerver.lib.stream_subscription import subscriber_ids_with_stream_history_access
from zerver.lib.streams import access_stream_by_id
from zerver.models import Message, Reaction, Recipient, Stream, UserMessage, UserProfile
@ -41,7 +41,7 @@ def notify_reaction_update(
}
# Update the cached message since new reaction is added.
update_to_dict_cache([message])
update_message_cache([message])
# Recipients for message update events, including reactions, are
# everyone who got the original message, plus subscribers of

View File

@ -77,7 +77,7 @@ def message_to_dict_json(message: Message, realm_id: Optional[int] = None) -> by
return MessageDict.to_dict_uncached([message], realm_id)[message.id]
def update_to_dict_cache(
def update_message_cache(
changed_messages: Collection[Message], realm_id: Optional[int] = None
) -> List[int]:
"""Updates the message as stored in the to_dict cache (for serving