Files: 660713a09e56ca4799e4f891a0d70851cd142b51 / plugs / message / html / meta / private.js
703 bytesRaw
1 | const h = require('mutant/h') |
2 | const map = require('mutant/map') |
3 | const nest = require('depnest') |
4 | var msgs = require('ssb-msgs') |
5 | |
6 | exports.needs = nest({ |
7 | 'about.html.image': 'first', |
8 | 'about.obs.name': 'first' |
9 | }) |
10 | exports.gives = nest('message.html.meta') |
11 | |
12 | exports.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 | const feed = msgs.link(id, 'feed') |
17 | if (!feed) return |
18 | id = feed.link |
19 | return h('a', { |
20 | href: id, |
21 | title: api.about.obs.name(id) |
22 | }, [ |
23 | api.about.html.image(id) |
24 | ]) |
25 | })) |
26 | } |
27 | }) |
28 | } |
29 |
Built with git-ssb-web