From d23c6dff28491333ff5ea092ad564f35390dc9a7 Mon Sep 17 00:00:00 2001 From: julian laplace Date: Fri, 27 Mar 2026 15:14:43 +0100 Subject: fix body encoding --- bucky/app/bucky.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'bucky') diff --git a/bucky/app/bucky.js b/bucky/app/bucky.js index 81171f4..3e76e9b 100644 --- a/bucky/app/bucky.js +++ b/bucky/app/bucky.js @@ -92,7 +92,7 @@ var bucky = (module.exports = { res.threads_ids = threads.pluck("id").sort(); res.keywords = _.uniq(threads.pluck("keyword")); next(); - }) + }), ); } else if (query.thread) { db.getThread(query.thread).then((thread) => @@ -110,7 +110,7 @@ var bucky = (module.exports = { res.threads_ids = [query.thread]; res.keywords = [thread.get("keyword")]; next(); - }) + }), ); } else { Promise.all([ @@ -413,7 +413,7 @@ var bucky = (module.exports = { res.sendStatus(404); } db.getTopThreadsForUser(username, limit, offset).then(function ( - top_threads + top_threads, ) { res.topThreads = top_threads; res.topThreads_ids = res.topThreads.pluck("id").sort(); @@ -794,7 +794,7 @@ var bucky = (module.exports = { req.user.get("username"), req.params.box, limit, - offset + offset, ).then(function (messages) { res.messages = messages; res.query = { limit, offset }; @@ -815,6 +815,12 @@ var bucky = (module.exports = { return; } res.message = message; + + // Fix mail body encoding ... + const body = res.message.get("body"); + if (body instanceof Buffer) { + res.message.set("body", body.toString("utf8")); + } next(); }); }, -- cgit v1.2.3-70-g09d2