git ssb

16+

Dominic / patchbay



Commit a67310f0467e9b58b0c980e5f8c2e806b4239eee

modify notifications to show private scrys

mixmix committed on 10/10/2018, 9:20:31 PM
Parent: 8478e326670e34cff42f95e6e5cc2fe2fc5d996e

Files changed

app/page/notifications.jschanged
app/page/notifications.jsView
@@ -39,15 +39,15 @@
3939 function draw () {
4040 resetFeed({ container, content })
4141
4242 pull(
43- pullMentions({old: false, live: true}),
43 + pullMentions({ old: false, live: true }),
4444 filterDownThrough(),
4545 Scroller(container, content, api.message.html.render, true, false)
4646 )
4747
4848 pull(
49- pullMentions({reverse: true, live: false}),
49 + pullMentions({ reverse: true, live: false }),
5050 filterUpThrough(),
5151 Scroller(container, content, api.message.html.render, false, false)
5252 )
5353 }
@@ -56,17 +56,20 @@
5656 container.title = '/notifications'
5757 return container
5858 }
5959
60- // NOTE - this currently hits mentions AND the patchwork message replies
60 + // NOTE - currently this stream is know to pick up:
61 + // - post mentions (public)
62 + // - patchwork replies (public)
63 + // - scry (public, private)
64 +
6165 function pullMentions (opts) {
6266 const query = [{
6367 $filter: {
6468 dest: api.keys.sync.id(),
65- timestamp: {$gt: 0},
69 + timestamp: { $gt: 0 },
6670 value: {
67- author: {$ne: api.keys.sync.id()}, // not my messages!
68- private: {$ne: true} // not private mentions
71 + author: { $ne: api.keys.sync.id() } // not my messages!
6972 }
7073 }
7174 }]
7275
@@ -78,8 +81,12 @@
7881
7982 return api.sbot.pull.stream(server => {
8083 return pull(
8184 next(server.backlinks.read, _opts, ['timestamp']),
85 + pull.filter(m => {
86 + if (m.value.content.type !== 'post') return true
87 + return !m.value.private // no private posts
88 + }),
8289 pull.filter(m => !api.message.sync.isBlocked(m))
8390 )
8491 })
8592 }

Built with git-ssb-web