sbot/roots.jsView |
---|
25 | 25 | |
26 | 26 | var cache = HLRU(100) |
27 | 27 | |
28 | 28 | return { |
29 | | - latest: function ({ids = [ssb.id], onlySubscribedChannels = false}) { |
| 29 | + latest: function ({ids = [ssb.id]}) { |
30 | 30 | var stream = Defer.source() |
31 | 31 | getFilter((err, filter) => { |
32 | 32 | if (err) return stream.abort(err) |
33 | 33 | stream.resolve(pull( |
53 | 53 | var isPrivate = root.value && typeof root.value.content === 'string' |
54 | 54 | |
55 | 55 | if (filter && root && root.value && !isPrivate) { |
56 | 56 | var filterResult = filter(ids, root) |
57 | | - if (checkReplyForcesDisplay(item) || shouldShow(filterResult, {onlySubscribedChannels})) { |
| 57 | + if (checkReplyForcesDisplay(item) || shouldShow(filterResult)) { |
58 | 58 | root.filterResult = filterResult |
59 | 59 | return true |
60 | 60 | } |
61 | 61 | } |
64 | 64 | }) |
65 | 65 | return stream |
66 | 66 | }, |
67 | 67 | |
68 | | - read: function ({ids = [ssb.id], reverse, limit, lt, gt, onlySubscribedChannels = false}) { |
| 68 | + read: function ({ids = [ssb.id], reverse, limit, lt, gt}) { |
69 | 69 | var opts = {reverse, old: true} |
70 | 70 | |
71 | 71 | |
72 | 72 | if (lt && typeof lt.timestamp === 'number') lt = lt.timestamp |
117 | 117 | return true |
118 | 118 | } else if (!seen.has(root.key)) { |
119 | 119 | seen.add(root.key) |
120 | 120 | var filterResult = filter(ids, root) |
121 | | - if (shouldShow(filterResult, {onlySubscribedChannels})) { |
| 121 | + if (shouldShow(filterResult)) { |
122 | 122 | root.filterResult = filterResult |
123 | 123 | included.add(root.key) |
124 | 124 | return true |
125 | 125 | } |
158 | 158 | } |
159 | 159 | } |
160 | 160 | } |
161 | 161 | |
162 | | - function shouldShow (filterResult, {onlySubscribedChannels}) { |
163 | | - if (filterResult && onlySubscribedChannels && filterResult.hasChannel) { |
164 | | - return filterResult.matchesChannel || filterResult.matchingTags.length || filterResult.mentionsYou || filterResult.isYours |
165 | | - } else { |
166 | | - return !!filterResult |
167 | | - } |
| 162 | + function shouldShow (filterResult) { |
| 163 | + return !!filterResult |
168 | 164 | } |
169 | 165 | |
170 | 166 | function getThruCache (key, cb) { |
171 | 167 | if (cache.has(key)) { |