git ssb

10+

Matt McKegg / patchwork



Commit 59d3d0d716da753cf2d23af1ad3fab75bfc9dc93

don't show unfollows and unsubscribes in the main feed

#776
Matt McKegg committed on 4/15/2018, 3:14:52 AM
Parent: 72c9455d001722028f5f6d179b22404f79de3c65

Files changed

modules/page/html/render/public.jschanged
modules/page/html/render/public.jsView
@@ -106,12 +106,25 @@
106106 }
107107 }
108108 },
109109 rootFilter: function (msg) {
110+
111+ if (msg.value && msg.value.content && msg.value.content.type === 'contact') {
112+ // don't show unfollows in the main feed, but do show follows and blocks
113+ // we still show unfollows on a person's profile though
114+ if (msg.value.content.following === false && !msg.value.content.blocking) return false
115+ }
116+
117+ if (msg.value && msg.value.content && msg.value.content.type === 'channel') {
118+ // don't show channel unsubscribes in the main feed, but we still show on their profile
119+ if (msg.value.content.subscribed === false) return false
120+ }
121+
110122 // skip messages that are directly replaced by the previous message
111123 // e.g. follow / unfollow in quick succession
112124 // THIS IS A TOTAL HACK!!! SHOULD BE REPLACED WITH A PROPER ROLLUP!
113125 var isOutdated = isReplacementMessage(msg, lastMessage)
126+
114127 if (checkFeedFilter(msg) && !isOutdated) {
115128 lastMessage = msg
116129 return true
117130 }

Built with git-ssb-web