From 7466990370952e130b2cd79711f4ed2610c24a1f Mon Sep 17 00:00:00 2001 From: cel Date: Tue, 15 Aug 2017 13:02:01 -1000 Subject: Use raw message ids in links by default --- lib/app.js | 1 + lib/render.js | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/app.js b/lib/app.js index b122f1d..b12051a 100644 --- a/lib/app.js +++ b/lib/app.js @@ -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 -- cgit v1.2.3