peerlinks/peerlinks-desktop

images

Closed this issue · 2 comments

n/t

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.

  1. The user clicks the "clip" button and select the file
  2. 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)
  3. The image is displayed as the data-uri

This way people who view the chat will be able to:

  1. See images while they are offline
  2. Avoid tracking by 3rd-party servers hosting the images

Just to remember.

We'll use a specific json payload for image upload :

{
  "attachments": {
    "file.png": { "content-type": "image/png", "data": "base64...." },
  }
}