git ssb

0+

alanz / patchwork



forked from Matt McKegg / patchwork

Commit 957f1f84e213da64909ab15f389f31f11432240c

public: hide subscription notifications from people you don't follow

Matt McKegg committed on 4/7/2017, 6:12:19 AM
Parent: df697b6ed4d32422df439d0d48d65a64d1d9b04a

Files changed

modules/page/html/render/public.jschanged
modules/page/html/render/public.jsView
@@ -73,12 +73,22 @@
7373 subscribedChannels.sync
7474 ], (...x) => x.every(Boolean)),
7575 windowSize: 500,
7676 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+
7786 return !item.boxed && (
7887 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) ||
8191 (item.repliesFrom && item.repliesFrom.has(id)) ||
8292 item.likes && item.likes.has(id)
8393 )
8494 },

Built with git-ssb-web