Commit 59d3d0d716da753cf2d23af1ad3fab75bfc9dc93
don't show unfollows and unsubscribes in the main feed
#776Matt McKegg committed on 4/15/2018, 3:14:52 AM
Parent: 72c9455d001722028f5f6d179b22404f79de3c65
Files changed
modules/page/html/render/public.js | changed |
modules/page/html/render/public.js | ||
---|---|---|
@@ -106,12 +106,25 @@ | ||
106 | 106 | } |
107 | 107 | } |
108 | 108 | }, |
109 | 109 | 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 | + | |
110 | 122 | // skip messages that are directly replaced by the previous message |
111 | 123 | // e.g. follow / unfollow in quick succession |
112 | 124 | // THIS IS A TOTAL HACK!!! SHOULD BE REPLACED WITH A PROPER ROLLUP! |
113 | 125 | var isOutdated = isReplacementMessage(msg, lastMessage) |
126 | + | |
114 | 127 | if (checkFeedFilter(msg) && !isOutdated) { |
115 | 128 | lastMessage = msg |
116 | 129 | return true |
117 | 130 | } |
Built with git-ssb-web