Commit 957f1f84e213da64909ab15f389f31f11432240c
public: hide subscription notifications from people you don't follow
Matt McKegg committed on 4/7/2017, 6:12:19 AMParent: df697b6ed4d32422df439d0d48d65a64d1d9b04a
Files changed
modules/page/html/render/public.js | changed |
modules/page/html/render/public.js | ||
---|---|---|
@@ -73,12 +73,22 @@ | ||
73 | 73 | subscribedChannels.sync |
74 | 74 | ], (...x) => x.every(Boolean)), |
75 | 75 | windowSize: 500, |
76 | 76 | filter: (item) => { |
77 | + if (item.type === 'subscribe') { | |
78 | + // HACK: hide people you don't follow from subscribe notifications: | |
79 | + Array.from(item.subscribers).forEach(id => { | |
80 | + if (!following().has(id)) { | |
81 | + item.subscribers.delete(id) | |
82 | + } | |
83 | + }) | |
84 | + } | |
85 | + | |
77 | 86 | return !item.boxed && ( |
78 | 87 | id === item.author || |
79 | - following().has(item.author) || | |
80 | - subscribedChannels().has(item.channel) || | |
88 | + (item.author && following().has(item.author)) || | |
89 | + (item.type === 'message' && subscribedChannels().has(item.channel)) || | |
90 | + (item.type === 'subscribe' && item.subscribers.size) || | |
81 | 91 | (item.repliesFrom && item.repliesFrom.has(id)) || |
82 | 92 | item.likes && item.likes.has(id) |
83 | 93 | ) |
84 | 94 | }, |
Built with git-ssb-web