git ssb

10+

Matt McKegg / patchwork



Commit 8de1edb8454d207982be32e1b3b5a6e3497f19ce

don't include blocked people in "Who to follow"

Matt McKegg committed on 11/14/2017, 10:07:23 PM
Parent: 72efc85421d9d1773e46a9b1109d05b192a8e76f

Files changed

modules/page/html/render/public.jschanged
modules/page/html/render/public.jsView
@@ -23,8 +23,9 @@
2323
2424 'feed.html.rollup': 'first',
2525 'profile.obs.recentlyUpdated': 'first',
2626 'contact.obs.following': 'first',
27+ 'contact.obs.blocking': 'first',
2728 'channel.obs': {
2829 subscribed: 'first',
2930 recent: 'first'
3031 },
@@ -45,8 +46,9 @@
4546 if (path !== '/public') return // "/" is a sigil for "page"
4647
4748 var id = api.keys.sync.id()
4849 var following = api.contact.obs.following(id)
50+ var blocking = api.contact.obs.blocking(id)
4951 var subscribedChannels = api.channel.obs.subscribed(id)
5052 var recentChannels = api.channel.obs.recent()
5153 var loading = computed([subscribedChannels.sync, recentChannels.sync], (...args) => !args.every(Boolean))
5254 var channels = computed(recentChannels, items => items.slice(0, 8), {comparer: arrayEq})
@@ -137,10 +139,10 @@
137139 }
138140 }
139141
140142 function getSidebar () {
141- var whoToFollow = computed([following, api.profile.obs.recentlyUpdated(), localPeers], (following, recent, peers) => {
142- return recent.filter(x => x !== id && !following.includes(x) && !peers.includes(x)).slice(0, 10)
143+ var whoToFollow = computed([api.profile.obs.recentlyUpdated(), following, blocking, localPeers], (recent, ...ignoreFeeds) => {
144+ return recent.filter(x => x !== id && !ignoreFeeds.some(f => f.includes(x))).slice(0, 10)
143145 })
144146 return [
145147 h('button -pub -full', {
146148 'ev-click': api.invite.sheet

Built with git-ssb-web