Co-authored-by: alansley <aclansley@gmail.com>
pull/1710/head
AL-Session 3 months ago committed by GitHub
parent 5cd8e349ec
commit a17a29f5d8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -75,9 +75,12 @@ class Attachment {
.setDigest(ByteString.copyFrom(attachment.digest.get()))
.setSize(attachment.size.get())
.setUrl(attachment.url)
// Filenames are now mandatory
builder.fileName = attachment.filename
// Filenames are now mandatory for picked/shared files, Giphy GIFs, and captured photos.
// The images associated with LinkPreviews don't have a "given name" so we'll use the
// attachment ID as the filename. It's not possible to save these preview images or see
// the filename, so what the filename IS isn't important, only that a filename exists.
builder.fileName = attachment.filename ?: attachment.id.toString()
if (attachment.preview.isPresent) { builder.thumbnail = ByteString.copyFrom(attachment.preview.get()) }
if (attachment.width > 0) { builder.width = attachment.width }

Loading…
Cancel
Save