git ssb

10+

Matt McKegg / patchwork



Commit 5eaed9654b9fe9dd9e0038fe8d0cffbe584237d3

add private message page

Matt McKegg committed on 2/15/2017, 12:17:46 PM
Parent: 4d85ac536daebe91e633293a07809820d79428ba

Files changed

main-window.jschanged
modules/page/html/render/private.jschanged
main-window.jsView
@@ -47,9 +47,9 @@
4747
4848 var views = MutantDict({
4949 // preload tabs (and subscribe to update notifications)
5050 '/public': renderPage('/public'),
51- // '/private': renderPage('/private'),
51 + '/private': renderPage('/private'),
5252 // [ssbClient.id]: renderPage(ssbClient.id),
5353 // '/notifications': renderPage('/notifications')
5454 })
5555
@@ -94,9 +94,9 @@
9494 }, '>')
9595 ]),
9696 h('span.nav', [
9797 tab('Public', '/public'),
98- //tab('Private', '/private')
98 + tab('Private', '/private')
9999 ]),
100100 h('span.appTitle', ['Patchwork']),
101101 h('span', [ searchBox ]),
102102 h('span.nav', [
modules/page/html/render/private.jsView
@@ -1,0 +1,34 @@
1 +var nest = require('depnest')
2 +var ref = require('ssb-ref')
3 +
4 +exports.needs = nest({
5 + 'feed.html.rollup': 'first',
6 + 'feed.pull.private': 'first',
7 + 'keys.sync.id': 'first'
8 +})
9 +
10 +exports.gives = nest('page.html.render')
11 +
12 +exports.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 })
33 + })
34 +}

Built with git-ssb-web