conversion: Generate attachment_ids with helpers.

This commit is contained in:
Steve Howell
2018-10-28 17:32:15 +00:00
committed by Tim Abbott
parent 5cb60f7bea
commit 00f822a26a
4 changed files with 13 additions and 17 deletions

View File

@@ -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'],