Commit a67310f0467e9b58b0c980e5f8c2e806b4239eee
modify notifications to show private scrys
mixmix committed on 10/10/2018, 9:20:31 PMParent: 8478e326670e34cff42f95e6e5cc2fe2fc5d996e
Files changed
app/page/notifications.js | changed |
app/page/notifications.js | |||
---|---|---|---|
@@ -39,15 +39,15 @@ | |||
39 | 39 … | function draw () { | |
40 | 40 … | resetFeed({ container, content }) | |
41 | 41 … | ||
42 | 42 … | pull( | |
43 | - pullMentions({old: false, live: true}), | ||
43 … | + pullMentions({ old: false, live: true }), | ||
44 | 44 … | filterDownThrough(), | |
45 | 45 … | Scroller(container, content, api.message.html.render, true, false) | |
46 | 46 … | ) | |
47 | 47 … | ||
48 | 48 … | pull( | |
49 | - pullMentions({reverse: true, live: false}), | ||
49 … | + pullMentions({ reverse: true, live: false }), | ||
50 | 50 … | filterUpThrough(), | |
51 | 51 … | Scroller(container, content, api.message.html.render, false, false) | |
52 | 52 … | ) | |
53 | 53 … | } | |
@@ -56,17 +56,20 @@ | |||
56 | 56 … | container.title = '/notifications' | |
57 | 57 … | return container | |
58 | 58 … | } | |
59 | 59 … | ||
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 … | + | ||
61 | 65 … | function pullMentions (opts) { | |
62 | 66 … | const query = [{ | |
63 | 67 … | $filter: { | |
64 | 68 … | dest: api.keys.sync.id(), | |
65 | - timestamp: {$gt: 0}, | ||
69 … | + timestamp: { $gt: 0 }, | ||
66 | 70 … | 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! | ||
69 | 72 … | } | |
70 | 73 … | } | |
71 | 74 … | }] | |
72 | 75 … | ||
@@ -78,8 +81,12 @@ | |||
78 | 81 … | ||
79 | 82 … | return api.sbot.pull.stream(server => { | |
80 | 83 … | return pull( | |
81 | 84 … | 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 … | + }), | ||
82 | 89 … | pull.filter(m => !api.message.sync.isBlocked(m)) | |
83 | 90 … | ) | |
84 | 91 … | }) | |
85 | 92 … | } |
Built with git-ssb-web