From 8f8f334d5eb06c64ab67e1ea266da696c54ad116 Mon Sep 17 00:00:00 2001 From: cel Date: Thu, 13 Apr 2017 02:24:35 -0700 Subject: Dig in channel --- lib/render-msg.js | 2 ++ lib/serve.js | 1 + 2 files changed, 3 insertions(+) (limited to 'lib') diff --git a/lib/render-msg.js b/lib/render-msg.js index 87e0364..faf5a84 100644 --- a/lib/render-msg.js +++ b/lib/render-msg.js @@ -171,10 +171,12 @@ RenderMsg.prototype.recpsIds = function () { } RenderMsg.prototype.voteFormInner = function (expression) { + var chan = this.msg.value.content.channel return [ h('input', {type: 'hidden', name: 'action', value: 'vote'}), h('input', {type: 'hidden', name: 'recps', value: this.recpsIds().join(',')}), + chan ? h('input', {type: 'hidden', name: 'channel', value: chan}) : '', h('input', {type: 'hidden', name: 'link', value: this.msg.key}), h('input', {type: 'hidden', name: 'value', value: 1}), h('input', {type: 'submit', name: 'expression', value: expression})] diff --git a/lib/serve.js b/lib/serve.js index 9137bc5..fe2ab39 100644 --- a/lib/serve.js +++ b/lib/serve.js @@ -143,6 +143,7 @@ Serve.prototype.publishJSON = function (cb) { Serve.prototype.publishVote = function (cb) { var content = { type: 'vote', + channel: this.data.channel || undefined, vote: { link: this.data.link, value: Number(this.data.value), -- cgit v1.2.3