aboutsummaryrefslogtreecommitdiff
path: root/lib/render-msg.js
diff options
context:
space:
mode:
authorcel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2019-01-09 10:51:44 -1000
committercel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2019-01-09 10:51:44 -1000
commitb10544275bc5120992629a4a0a09c5a74dabd41c (patch)
tree386ee3aa853a698ae18bdd97494affb407eb0c4e /lib/render-msg.js
parentd55d5e212eb177da7a569c952ce639c4f0a10bb1 (diff)
downloadpatchfoo-b10544275bc5120992629a4a0a09c5a74dabd41c.tar.gz
patchfoo-b10544275bc5120992629a4a0a09c5a74dabd41c.zip
Render pub-owner-announce and pub-owner-confirm messages
Diffstat (limited to 'lib/render-msg.js')
-rw-r--r--lib/render-msg.js26
1 files changed, 25 insertions, 1 deletions
diff --git a/lib/render-msg.js b/lib/render-msg.js
index 6501d7d..846700f 100644
--- a/lib/render-msg.js
+++ b/lib/render-msg.js
@@ -331,6 +331,8 @@ RenderMsg.prototype.message = function (cb) {
case 'invite': return this.invite(cb)
case 'ssb-igo': return this.igo(cb)
case 'address': return this.address(cb)
+ case 'pub-owner-announce': return this.pubOwnerAnnounce(cb)
+ case 'pub-owner-confirm': return this.pubOwnerConfirm(cb)
default: return this.object(cb)
}
}
@@ -733,13 +735,35 @@ RenderMsg.prototype.address = function (cb) {
this.wrapMini([
'has address',
!isNaN(availability) ? [
- ' with availability ', h('code', String(availability + '%'))
+ ' with availability ',
+ h('code', availability + '%')
] : '',
': ',
h('input', {disabled: 'disabled', value: String(this.c.address), style: 'width:100%'}),
], cb)
}
+RenderMsg.prototype.pubOwnerAnnounce = function (cb) {
+ var self = this
+ self.link(self.c.pub, function (err, pubLink) {
+ if (err) return cb(err)
+ self.wrapMini(['announces ownership of pub ', pubLink], cb)
+ })
+}
+
+RenderMsg.prototype.pubOwnerConfirm = function (cb) {
+ var self = this
+ var announcement = this.c.announcement
+ this.wrap([
+ 'confirms pub ownership announcement ',
+ h('a', {href: this.toUrl(announcement)}, truncate(announcement, 10)),
+ this.c.address ? [
+ '. address: ',
+ 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([