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.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([