git ssb

0+

alanz / patchwork



forked from Matt McKegg / patchwork

Tree: be8e636ad6ac100c2299cc221a5e35e396a1ece6

Files: be8e636ad6ac100c2299cc221a5e35e396a1ece6 / plugs / message / html / meta / private.js

651 bytesRaw
1const h = require('mutant/h')
2const map = require('mutant/map')
3const nest = require('depnest')
4var msgs = require('ssb-msgs')
5
6exports.needs = nest({
7 'about.html.image': 'first',
8 'about.obs.name': 'first'
9})
10exports.gives = nest('message.html.meta')
11
12exports.create = (api) => {
13 return nest('message.html.meta', function privateMeta (msg) {
14 if (msg.value.private) {
15 return h('span.private', map(msg.value.content.recps, id => {
16 id = msgs.link(id, 'feed').link
17 return h('a', {
18 href: id,
19 title: api.about.obs.name(id)
20 }, [
21 api.about.html.image(id)
22 ])
23 }))
24 }
25 })
26}
27

Built with git-ssb-web