git ssb

16+

Dominic / patchbay



Tree: 0317853c50ffacda585e8b019f18d3b8ff32329a

Files: 0317853c50ffacda585e8b019f18d3b8ff32329a / modules / private.js

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

Built with git-ssb-web