git ssb

16+

Dominic / patchbay



Tree: 9ae49c99c4e15aee20a0b51e586caccd37d33d1e

Files: 9ae49c99c4e15aee20a0b51e586caccd37d33d1e / modules / private.js

1088 bytesRaw
1var h = require('hyperscript')
2var ui = require('../ui')
3var u = require('../util')
4var pull = require('pull-stream')
5var Scroller = require('pull-scroll')
6
7function unbox(msg) {
8 return u.first(exports.message_unbox, function (fn) {
9 return fn(msg)
10 })
11}
12
13exports.screen_view = function (path, sbot) {
14 if(path === '/private') {
15
16 var content = h('div.column')
17
18 var div = h('div.column', {style: {'overflow':'auto'}}, content)
19 var render = ui.createRenderers(exports.message_render, sbot)
20
21 pull(
22 u.next(
23 sbot.createLogStream.bind(sbot),
24 {reverse: true, limit: 1000}
25//,
26// 'lt', 'timestamp'
27 ),
28 pull.through(function (e) {
29 console.log('msg')
30 }),
31 pull.filter(function (msg) {
32 return 'string' == typeof msg.value.content
33 }),
34 pull.map(unbox),
35 pull.filter(Boolean),
36 Scroller(div, content, render, false, false, function (err) {
37 if(err) throw err
38 })
39 )
40
41 return div
42 }
43}
44
45exports.message_render = []
46exports.message_compose = []
47exports.message_unbox = []
48
49
50

Built with git-ssb-web