mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 13:33:24 +00:00
conversion: Generate attachment_ids with helpers.
This commit is contained in:
@@ -348,13 +348,15 @@ def build_message(subject: str, pub_date: float, message_id: int, content: str,
|
||||
|
||||
return zulip_message_dict
|
||||
|
||||
def build_attachment(realm_id: int, message_ids: Set[int], attachment_id: int,
|
||||
def build_attachment(realm_id: int, message_ids: Set[int],
|
||||
user_id: int, fileinfo: ZerverFieldsT, s3_path: str,
|
||||
zerver_attachment: List[ZerverFieldsT]) -> None:
|
||||
"""
|
||||
This function should be passed a 'fileinfo' dictionary, which contains
|
||||
information about 'size', 'created' (created time) and ['name'] (filename).
|
||||
"""
|
||||
attachment_id = NEXT_ID('attachment')
|
||||
|
||||
attachment = Attachment(
|
||||
id=attachment_id,
|
||||
size=fileinfo['size'],
|
||||
|
||||
Reference in New Issue
Block a user