aboutsummaryrefslogtreecommitdiff
path: root/lib/render.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/render.js')
-rw-r--r--lib/render.js23
1 files changed, 8 insertions, 15 deletions
diff --git a/lib/render.js b/lib/render.js
index ed8cb1a..eaca499 100644
--- a/lib/render.js
+++ b/lib/render.js
@@ -197,24 +197,17 @@ Render.prototype.privateLine = function (recps, cb) {
return el
}
-Render.prototype.publish = function (content, cb) {
+Render.prototype.msgLink = function (msg, cb) {
var self = this
-
var el = h('div')
- self.app.publish(content, function (err, msg) {
+ self.app.unboxMsg(msg, function (err, msg) {
if (err) return el.appendChild(u.renderError(err)), cb()
- self.app.unboxMsg(msg, function (err, msg) {
- if (err) return el.appendChild(u.renderError(err)), cb()
- self.renderMsg(msg, false, function (err, msgEl) {
- if (err) msgEl = [
- h('a', {href: self.toUrl(msg.key)}, msg.key),
- u.renderError(err)]
- el.appendChild(h('div',
- 'published:',
- h('table.ssb-msgs', msgEl)
- ))
- cb()
- })
+ self.renderMsg(msg, false, function (err, msgEl) {
+ if (err) msgEl = [
+ h('a', {href: self.toUrl(msg.key)}, msg.key),
+ u.renderError(err)]
+ el.appendChild(h('table.ssb-msgs', msgEl))
+ cb()
})
})
return el