git ssb

1+

punkmonk.termux / mvd



forked from ev / mvd

Commit 7de96928528bf3b5357e79b7c622297f17220808

use ssb-query to get private stream

Ev Bogue committed on 12/12/2018, 4:24:18 PM
Parent: a79d9f1113c588296702c476437289c91f815c3f

Files changed

views.jschanged
views.jsView
@@ -42,8 +42,44 @@
4242 screen.appendChild(hyperscroll(content))
4343
4444 function createStream (opts) {
4545 return pull(
46+ Next(sbot.query, opts, ['value', 'timestamp']),
47+ pull.map(function (msg) {
48+ if (msg.value) {
49+ if (msg.value.timestamp > Date.now()) {
50+ return h('div.future')
51+ } else {
52+ return render(msg)
53+ }
54+ }
55+ })
56+ )
57+ }
58+
59+ pull(
60+ createStream({
61+ limit: 10,
62+ reverse: true,
63+ live: false,
64+ query: [{$filter: { value: { private: true, timestamp: { $gt: 0 }}}}]
65+ }),
66+ stream.bottom(content)
67+ )
68+
69+ pull(
70+ createStream({
71+ limit: 10,
72+ old: false,
73+ live: true,
74+ query: [{$filter: { value: { private: true, timestamp: { $gt: 0 }}}}]
75+ }),
76+ stream.top(content)
77+ )
78+
79+
80+ /*function createStream (opts) {
81+ return pull(
4682 More(sbot.createLogStream, opts),
4783 pull.filter(function (msg) {
4884 return 'string' == typeof msg.value.content
4985 }),
@@ -68,9 +104,9 @@
68104
69105 pull(
70106 createStream({reverse: true, live: false, limit: 1000}),
71107 stream.bottom(content)
72- )
108+ )*/
73109 }
74110
75111 var queueStream = function () {
76112 var content = h('div.content')

Built with git-ssb-web