git ssb

16+

Dominic / patchbay



Tree: 15c8b380dff5fefb550257e46b87876bda2db1e4

Files: 15c8b380dff5fefb550257e46b87876bda2db1e4 / modules / private.js

1095 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 () {
8 return pull(
9 pull.filter(function (msg) {
10 return 'string' == typeof msg.value.content
11 }),
12 pull.map(function (msg) {
13 return u.firstPlug(exports.message_unbox, msg)
14 }),
15 pull.filter(Boolean)
16 )
17}
18
19exports.screen_view = function (path, sbot) {
20 if(path === '/private') {
21
22 var content = h('div.column')
23
24 var div = h('div.column', {style: {'overflow':'auto'}}, content)
25 var render = ui.createRenderers(exports.message_render, sbot)
26
27 pull(
28 sbot.createLogStream({old: false}),
29 unbox(),
30 Scroller(div, content, render, true, false)
31 )
32
33 pull(
34 u.next(sbot.createLogStream, {reverse: true, limit: 1000}),
35 unbox(),
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
51
52
53
54
55
56
57
58
59
60

Built with git-ssb-web