From 3741cbcbc06e5deeeb8229aae8a52557d442b3c9 Mon Sep 17 00:00:00 2001 From: ansuz Date: Wed, 5 Feb 2020 12:22:53 -0500 Subject: [PATCH] rewrite trimmed history WITH newlines --- lib/rpc.js | 2 -- storage/file.js | 6 +++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/rpc.js b/lib/rpc.js index 11a9bb06f..9c48a187e 100644 --- a/lib/rpc.js +++ b/lib/rpc.js @@ -140,7 +140,6 @@ const AUTHENTICATED_USER_SCOPED = { var handleAuthenticatedMessage = function (Env, map) { var msg = map.msg; var safeKey = map.safeKey; - var publicKey = map.publicKey; var Respond = map.Respond; var Server = map.Server; @@ -278,7 +277,6 @@ var rpc = function (Env, Server, data, respond) { handleAuthenticatedMessage(Env, { msg: msg, safeKey: safeKey, - publicKey: publicKey, Respond: Respond, Server: Server, }); diff --git a/storage/file.js b/storage/file.js index 09b743ace..92e8cceee 100644 --- a/storage/file.js +++ b/storage/file.js @@ -959,17 +959,17 @@ var trimChannel = function (env, channelName, hash, _cb) { return readMore(); } + var s_msg = msgObj.buff.toString('utf8'); if (retain) { // if this flag is set then you've already found // the message you were looking for. // write it to your temp buffer and keep going - return void tempStream.write(msgObj.buff, function () { + return void tempStream.write(s_msg + '\n', function () { readMore(); }); } - var msg = Util.tryParse(msgObj.buff.toString('utf8')); - + var msg = Util.tryParse(s_msg); var msgHash = Extras.getHash(msg[4]); if (msgHash === hash) {