aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2019-01-09 10:38:56 -1000
committercel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2019-01-09 10:38:56 -1000
commitd55d5e212eb177da7a569c952ce639c4f0a10bb1 (patch)
tree7525bc520037bf219376a01e51a1628a58ed029d
parente8eb271296e7f928e01e4260d6681593d232381f (diff)
downloadpatchfoo-d55d5e212eb177da7a569c952ce639c4f0a10bb1.tar.gz
patchfoo-d55d5e212eb177da7a569c952ce639c4f0a10bb1.zip
Render address messages
-rw-r--r--lib/render-msg.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/render-msg.js b/lib/render-msg.js
index 9308495..6501d7d 100644
--- a/lib/render-msg.js
+++ b/lib/render-msg.js
@@ -330,6 +330,7 @@ RenderMsg.prototype.message = function (cb) {
case 'dark-crystal/shard': return this.shard(cb)
case 'invite': return this.invite(cb)
case 'ssb-igo': return this.igo(cb)
+ case 'address': return this.address(cb)
default: return this.object(cb)
}
}
@@ -727,6 +728,18 @@ RenderMsg.prototype.pub = function (cb) {
})
}
+RenderMsg.prototype.address = function (cb) {
+ var availability = this.c.availability * 100
+ this.wrapMini([
+ 'has address',
+ !isNaN(availability) ? [
+ ' with availability ', h('code', String(availability + '%'))
+ ] : '',
+ ': ',
+ h('input', {disabled: 'disabled', value: String(this.c.address), style: 'width:100%'}),
+ ], cb)
+}
+
RenderMsg.prototype.channel = function (cb) {
var chan = '#' + this.c.channel
this.wrapMini([