From d55d5e212eb177da7a569c952ce639c4f0a10bb1 Mon Sep 17 00:00:00 2001 From: cel Date: Wed, 9 Jan 2019 10:38:56 -1000 Subject: Render address messages --- lib/render-msg.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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([ -- cgit v1.2.3