From 544a8927a47bc0e4cc2f925b0dd248668701c906 Mon Sep 17 00:00:00 2001 From: cel Date: Fri, 23 Nov 2018 14:48:00 -1000 Subject: Add root and branch to vote messages ref: %gdDgsa46yHeHkFrCMSUwbRboOA2xFxhMjGqmt48EapM=.sha256 --- lib/serve.js | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lib/serve.js') diff --git a/lib/serve.js b/lib/serve.js index 4188269..9d59fa4 100644 --- a/lib/serve.js +++ b/lib/serve.js @@ -190,6 +190,8 @@ Serve.prototype.publishVote = function (next) { var content = { type: 'vote', channel: this.data.channel || undefined, + root: this.data.root || undefined, + branch: this.data.branches ? this.data.branches.split(',') : undefined, vote: { link: this.data.link, value: Number(this.data.vote_value), @@ -1234,6 +1236,13 @@ Serve.prototype.streamThreadWithComposer = function (opts) { var branches = threadHeads(links, threadRootId) cb(null, pull( pull.values(sort(links)), + pull.map(function (link) { + var o = {} + for (var k in link) o[k] = link[k] + o.threadBranches = branches + o.threadRoot = threadRootId + return o + }), self.renderThread({ msgId: id, branches: branches, -- cgit v1.2.3