aboutsummaryrefslogtreecommitdiff
path: root/lib/render-msg.js
diff options
context:
space:
mode:
authorcel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2019-01-31 10:13:38 -1000
committercel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2019-01-31 10:13:38 -1000
commit6c896844bd483f98e57fc9c5528f66a0bb63667f (patch)
tree45c1d185e41bacc105273246027024fe669c75e3 /lib/render-msg.js
parent9b7c66e9644594fa04a5b88ee37583093b9b84dd (diff)
downloadpatchfoo-6c896844bd483f98e57fc9c5528f66a0bb63667f.tar.gz
patchfoo-6c896844bd483f98e57fc9c5528f66a0bb63667f.zip
Render user-invite
Diffstat (limited to 'lib/render-msg.js')
-rw-r--r--lib/render-msg.js28
1 files changed, 28 insertions, 0 deletions
diff --git a/lib/render-msg.js b/lib/render-msg.js
index 2f265b9..722b709 100644
--- a/lib/render-msg.js
+++ b/lib/render-msg.js
@@ -3,6 +3,9 @@ var htime = require('human-time')
var multicb = require('multicb')
var u = require('./util')
var mdInline = require('./markdown-inline')
+/*
+var ssbKeys = require('ssb-keys')
+*/
module.exports = RenderMsg
@@ -338,6 +341,7 @@ RenderMsg.prototype.message = function (cb) {
case 'address': return this.address(cb)
case 'pub-owner-announce': return this.pubOwnerAnnounce(cb)
case 'pub-owner-confirm': return this.pubOwnerConfirm(cb)
+ case 'user-invite': return this.userInvite(cb)
default: return this.object(cb)
}
}
@@ -789,6 +793,30 @@ RenderMsg.prototype.pubOwnerConfirm = function (cb) {
], cb)
}
+RenderMsg.prototype.userInvite = function (cb) {
+ this.wrapMini('user invite', cb)
+/*
+ var self = this
+ var invite = this.c.invite
+ var host = this.c.host
+ var author = this.msg.value.author
+ // this.c.private
+ // this.c.reveal
+ var isValid = ssbKeys.verifyObj(invite, this.serve.app.userInviteCap, this.c)
+ if (host && host !== author) self.link(host, gotHostLink)
+ else gotHostLink()
+ function gotHostLink(err, hostLink) {
+ if (err) return cb(err)
+ self.wrap([
+ isValid ? 'valid ' : 'invalid ',
+ 'user invite',
+ hostLink ? [' from ', hostLink] : '',
+ h('a', {href: self.toUrl(invite)}, truncate(invite, 10)),
+ ], cb)
+ }
+ */
+}
+
RenderMsg.prototype.channel = function (cb) {
var chan = '#' + this.c.channel
this.wrapMini([