images
Closed this issue · 2 comments
indutny commented
n/t
indutny commented
The obvious way of doing it would be to simply change CSP to allow external images. However, I believe that the better way of approaching it would be not to allow external images, but rather by having embedded attachments.
- The user clicks the "clip" button and select the file
- The file is base64 encoded and put in some json field of the message (we might need to come out with a spec for the message schema)
- The image is displayed as the data-uri
This way people who view the chat will be able to:
- See images while they are offline
- Avoid tracking by 3rd-party servers hosting the images
tony-go commented
Just to remember.
We'll use a specific json payload for image upload :
{
"attachments": {
"file.png": { "content-type": "image/png", "data": "base64...." },
}
}