upload: Rename .source to .vips_source.

This commit is contained in:
Alex Vandiver
2025-07-22 03:31:57 +00:00
committed by Tim Abbott
parent 28cb68117f
commit 183da665ac
6 changed files with 17 additions and 11 deletions

View File

@@ -279,9 +279,12 @@ class S3UploadBackend(ZulipUploadBackend):
def s3_read(streamingbody: StreamingBody, size: int) -> bytes:
return streamingbody.read(amt=size)
source: pyvips.Source = pyvips.SourceCustom()
source.on_read(partial(s3_read, metadata["Body"]))
return StreamingSourceWithSize(size=metadata["ContentLength"], source=source)
vips_source: pyvips.Source = pyvips.SourceCustom()
vips_source.on_read(partial(s3_read, metadata["Body"]))
return StreamingSourceWithSize(
size=metadata["ContentLength"],
vips_source=vips_source,
)
@override
def delete_message_attachment(self, path_id: str) -> bool: