git ssb

0+

alanz / patchwork



forked from Matt McKegg / patchwork

Tree: 92da6bade76258ec689b2cc1babe451d06a8279b

Files: 92da6bade76258ec689b2cc1babe451d06a8279b / modules / page / html / render / private.js

1120 bytesRaw
1var nest = require('depnest')
2var ref = require('ssb-ref')
3
4exports.needs = nest({
5 'feed.html.rollup': 'first',
6 'feed.pull.private': 'first',
7 'keys.sync.id': 'first'
8})
9
10exports.gives = nest('page.html.render')
11
12exports.create = function (api) {
13 return nest('page.html.render', function channel (path) {
14 if (path !== '/private') return
15
16 var id = api.keys.sync.id()
17 var prepend = [
18 // api.message.html.compose({type: 'post'}, {
19 // prepublish: function (msg) {
20 // msg.recps = [id].concat(msg.mentions).filter(function (e) {
21 // return ref.isFeed(typeof e === 'string' ? e : e.link)
22 // })
23 // if (!msg.recps.length) {
24 // throw new Error('cannot make private message without recipients - just mention the user in an at reply in the message you send')
25 // }
26 // return msg
27 // },
28 // placeholder: `Write a private message \n\n\n\nThis can only be read by yourself and people you have @mentioned.`
29 // })
30 ]
31
32 return api.feed.html.rollup(api.feed.pull.private, { prepend, windowSize: 10 })
33 })
34}
35

Built with git-ssb-web