message_send: Add forged_timestamp to internal_prep_stream_message.

This commit adds the "forged_timestamp" parameter to the
"internal_prep_stream_message" method of "actions/message_send".

This is a preparatory commit, that can be used for sending messages
at a forged time in scripts for generating screenshots of messages.
This commit is contained in:
roanster007
2024-05-14 19:47:29 +05:30
committed by Tim Abbott
parent 0a7c0ea326
commit 80634eb32b

View File

@@ -1794,6 +1794,8 @@ def _internal_prep_message(
mention_backend: Optional[MentionBackend] = None,
limit_unread_user_ids: Optional[Set[int]] = None,
disable_external_notifications: bool = False,
forged: bool = False,
forged_timestamp: Optional[float] = None,
) -> Optional[SendMessageRequest]:
"""
Create a message object and checks it, but doesn't send it or save it to the database.
@@ -1822,6 +1824,8 @@ def _internal_prep_message(
mention_backend=mention_backend,
limit_unread_user_ids=limit_unread_user_ids,
disable_external_notifications=disable_external_notifications,
forged=forged,
forged_timestamp=forged_timestamp,
)
except JsonableError as e:
logging.exception(
@@ -1842,6 +1846,8 @@ def internal_prep_stream_message(
*,
email_gateway: bool = False,
limit_unread_user_ids: Optional[Set[int]] = None,
forged: bool = False,
forged_timestamp: Optional[float] = None,
) -> Optional[SendMessageRequest]:
"""
See _internal_prep_message for details of how this works.
@@ -1856,6 +1862,8 @@ def internal_prep_stream_message(
content=content,
email_gateway=email_gateway,
limit_unread_user_ids=limit_unread_user_ids,
forged=forged,
forged_timestamp=forged_timestamp,
)