diff options
author | cel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519> | 2017-08-15 13:02:01 -1000 |
---|---|---|
committer | cel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519> | 2017-08-15 13:03:27 -1000 |
commit | 7466990370952e130b2cd79711f4ed2610c24a1f (patch) | |
tree | 7fc70769d2a29b0c768adce7de8436a5fd02433c | |
parent | 3572fc31a1187fcc46a1a4276b94deb17ea05d9e (diff) | |
download | patchfoo-7466990370952e130b2cd79711f4ed2610c24a1f.tar.gz patchfoo-7466990370952e130b2cd79711f4ed2610c24a1f.zip |
Use raw message ids in links by default
-rw-r--r-- | README.md | 1 | ||||
-rw-r--r-- | lib/app.js | 1 | ||||
-rw-r--r-- | lib/render.js | 3 |
3 files changed, 4 insertions, 1 deletions
@@ -81,6 +81,7 @@ To make config options persistent, set them in `~/.ssb/config`, e.g.: - `blob_base`: base url for links to ssb blobs. default: same as `base` - `img_base`: base url for blobs embedded as images. default: same as `base` - `emoji_base`: base url for emoji images. default: same as `base` +- `encode_msgids`: whether to URL-encode message ids. default: `false` [patchbay]: %s9mSFATE4RGyJx9wgH22lBrvD4CgUQW4yeguSWWjtqc=.sha256 @@ -29,6 +29,7 @@ function App(sbot, config) { blob_base: conf.blob_base || conf.img_base || base, img_base: conf.img_base || base, emoji_base: conf.emoji_base || (base + 'emoji/'), + encode_msgids: Boolean(conf.encode_msgids), } sbot.get = memo({cache: lru(100)}, sbot.get) diff --git a/lib/render.js b/lib/render.js index e9d4889..63eecd4 100644 --- a/lib/render.js +++ b/lib/render.js @@ -190,7 +190,8 @@ Render.prototype.toUrl = function (href) { switch (href[0]) { case '%': if (!u.isRef(href)) return false - return this.opts.base + encodeURIComponent(href) + return this.opts.base + + (this.opts.encode_msgids ? encodeURIComponent(href) : href) case '@': if (!u.isRef(href)) return false return this.opts.base + href |