diff options
Diffstat (limited to 'lib/serve.js')
-rw-r--r-- | lib/serve.js | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/serve.js b/lib/serve.js index e1770a3..5836965 100644 --- a/lib/serve.js +++ b/lib/serve.js @@ -659,7 +659,9 @@ Serve.prototype.wrapUserFeed = function (id) { Serve.prototype.wrapPublic = function (opts) { var self = this return u.hyperwrap(function (thread, cb) { - self.composer(null, function (err, composer) { + self.composer({ + channel: '', + }, function (err, composer) { if (err) return cb(err) cb(null, [ composer, @@ -694,7 +696,7 @@ Serve.prototype.wrapThread = function (opts) { placeholder: recps ? 'private reply' : 'reply', id: 'reply', root: opts.root, - channel: opts.channel, + channel: opts.channel || '', branches: opts.branches, recps: recps, }, function (err, composer) { @@ -770,7 +772,11 @@ Serve.prototype.composer = function (opts, cb) { done()(null, h('section.composer', h('form', {method: 'post', action: opts.id ? '#' + opts.id : ''}, opts.recps ? self.app.render.privateLine(opts.recps, done()) : - opts.private ? h('div', h('input.recps-input', {name: 'recps', value: data.recps || '', placeholder: 'recipient ids'})) : '', + opts.private ? h('div', h('input.recps-input', {name: 'recps', + value: data.recps || '', placeholder: 'recipient ids'})) : '', + data.channel || opts.channel != null ? + h('div', '#', h('input', {name: 'channel', placeholder: 'channel', + value: data.channel || opts.channel || ''})) : '', h('textarea', { id: opts.id, name: 'text', @@ -812,7 +818,7 @@ Serve.prototype.composer = function (opts, cb) { } if (opts.root) content.root = opts.root if (opts.branches) content.branch = u.fromArray(opts.branches) - if (opts.channel) content.channel = opts.channel + if (data.channel) content.channel = data.channel } var msg = { value: { |