Commit 7de96928528bf3b5357e79b7c622297f17220808
use ssb-query to get private stream
Ev Bogue committed on 12/12/2018, 4:24:18 PMParent: a79d9f1113c588296702c476437289c91f815c3f
Files changed
views.js | changed |
views.js | ||
---|---|---|
@@ -42,8 +42,44 @@ | ||
42 | 42 | screen.appendChild(hyperscroll(content)) |
43 | 43 | |
44 | 44 | function createStream (opts) { |
45 | 45 | 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( | |
46 | 82 | More(sbot.createLogStream, opts), |
47 | 83 | pull.filter(function (msg) { |
48 | 84 | return 'string' == typeof msg.value.content |
49 | 85 | }), |
@@ -68,9 +104,9 @@ | ||
68 | 104 | |
69 | 105 | pull( |
70 | 106 | createStream({reverse: true, live: false, limit: 1000}), |
71 | 107 | stream.bottom(content) |
72 | - ) | |
108 | + )*/ | |
73 | 109 | } |
74 | 110 | |
75 | 111 | var queueStream = function () { |
76 | 112 | var content = h('div.content') |
Built with git-ssb-web