Fall back to file name as hash for images

This commit is contained in:
Jon Staab
2025-12-04 14:37:59 -08:00
parent 10c12c3c48
commit ee444416e4

View File

@@ -21,7 +21,8 @@
.map(tagsFromIMeta) .map(tagsFromIMeta)
.find(meta => getTagValue("url", meta) === url) || event.tags .find(meta => getTagValue("url", meta) === url) || event.tags
const hash = getTagValue("x", meta) // Fallback to filename if hash was omitted from the message for interoperability
const hash = getTagValue("x", meta) || url.split(/[\/\.]/).slice(-2)[0]
const key = getTagValue("decryption-key", meta) const key = getTagValue("decryption-key", meta)
const nonce = getTagValue("decryption-nonce", meta) const nonce = getTagValue("decryption-nonce", meta)
const algorithm = getTagValue("encryption-algorithm", meta) const algorithm = getTagValue("encryption-algorithm", meta)