aboutsummaryrefslogtreecommitdiff
path: root/lib/render-msg.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/render-msg.js')
-rw-r--r--lib/render-msg.js29
1 files changed, 29 insertions, 0 deletions
diff --git a/lib/render-msg.js b/lib/render-msg.js
index 711a759..1873128 100644
--- a/lib/render-msg.js
+++ b/lib/render-msg.js
@@ -201,6 +201,7 @@ RenderMsg.prototype.message = function (raw, cb) {
case 'issue': return this.issue(cb)
case 'issue-edit': return this.issueEdit(cb)
case 'music-release-cc': return this.musicRelease(cb)
+ case 'ssb-dns': return this.dns(cb)
case 'ferment/audio':
case 'robeson/audio':
return this.audio(cb)
@@ -302,6 +303,9 @@ RenderMsg.prototype.title = function (cb) {
else
cb(null, '%' + self.c.type + ': ' + (self.c.title || title(self.c.text)))
} else {
+ if (self.c.type === 'ssb-dns')
+ cb(null, self.c.record && JSON.stringify(self.c.record.data) || self.msg.key)
+ else
self.app.getAbout(self.msg.key, function (err, about) {
if (err) return cb(err)
if (about.name) return cb(null, about.name)
@@ -652,6 +656,31 @@ RenderMsg.prototype.musicRelease = function (cb) {
], cb)
}
+RenderMsg.prototype.dns = function (cb) {
+ var self = this
+ var record = self.c.record || {}
+ var done = multicb({pluck: 1, spread: true})
+ var elCb = done()
+ self.wrap([
+ h('div',
+ h('p',
+ h('ins', {title: 'name'}, record.name), ' ',
+ h('span', {title: 'ttl'}, record.ttl), ' ',
+ h('span', {title: 'class'}, record.class), ' ',
+ h('span', {title: 'type'}, record.type)
+ ),
+ h('pre', {title: 'data'},
+ JSON.stringify(record.data || record.value, null, 2)),
+ !self.c.branch ? null : h('div',
+ 'replaces: ', u.toArray(self.c.branch).map(function (id, i) {
+ return [self.link1(id, done()), i === 0 ? ', ' : '']
+ })
+ )
+ )
+ ], elCb)
+ done(cb)
+}
+
RenderMsg.prototype.wifiNetwork = function (cb) {
var net = this.c.network || {}
this.wrap([