Commit df697b6ed4d32422df439d0d48d65a64d1d9b04a
swap channel subscription rollup around the other way (per channel)
Matt McKegg committed on 4/7/2017, 5:40:05 AMParent: bed484f1df0e3d56efaf7d40ae488bd6fd78cd87
Files changed
modules/feed/html/rollup.js | changed |
modules/feed/pull/summary.js | changed |
modules/feed/html/rollup.js | ||
---|---|---|
@@ -223,13 +223,13 @@ | ||
223 | 223 … | ]) |
224 | 224 … | } else if (item.type === 'subscribe') { |
225 | 225 … | return h('FeedEvent -subscribe', [ |
226 | 226 … | h('div.meta', { |
227 | - title: Array.from(item.channels).map(c => `#${c}`).join('\n') | |
227 … | + title: names(item.subscribers) | |
228 | 228 … | }, [ |
229 | - api.profile.html.person(item.id), ' subscribed to ', many(item.channels, (channel) => { | |
230 | - return h('a', {href: `#${channel}`}, `#${channel}`) | |
231 | - }) | |
229 … | + many(item.subscribers, api.profile.html.person), | |
230 … | + ' subscribed to ', | |
231 … | + h('a', {href: `#${item.channel}`}, `#${item.channel}`) | |
232 | 232 … | ]) |
233 | 233 … | ]) |
234 | 234 … | } |
235 | 235 … |
modules/feed/pull/summary.js | ||
---|---|---|
@@ -188,29 +188,28 @@ | ||
188 | 188 … | } |
189 | 189 … | |
190 | 190 … | function updateChannel (msg, groups) { |
191 | 191 … | var c = msg.value.content |
192 | - var id = msg.value.author | |
193 | - var group = groups[id] | |
194 | - if (typeof c.channel === 'string') { | |
192 … | + var channel = c.channel | |
193 … | + var group = groups[channel] | |
194 … | + if (typeof channel === 'string') { | |
195 | 195 … | if (c.subscribed) { |
196 | 196 … | if (!group) { |
197 | - group = groups[id] = { | |
197 … | + group = groups[channel] = { | |
198 | 198 … | type: 'subscribe', |
199 | 199 … | lastUpdateType: null, |
200 | - channels: new Set(), | |
200 … | + subscribers: new Set(), | |
201 | 201 … | updated: 0, |
202 | - author: id, | |
203 | - id: id | |
202 … | + channel | |
204 | 203 … | } |
205 | 204 … | } |
206 | - group.channels.add(c.channel) | |
205 … | + group.subscribers.add(msg.value.author) | |
207 | 206 … | group.updated = msg.timestamp || msg.value.sequence |
208 | 207 … | } else { |
209 | 208 … | if (group) { |
210 | - group.channels.delete(c.channel) | |
211 | - if (!group.channels.size) { | |
212 | - delete groups[id] | |
209 … | + group.subscribers.delete(msg.value.author) | |
210 … | + if (!group.subscribers.size) { | |
211 … | + delete groups[channel] | |
213 | 212 … | } |
214 | 213 … | } |
215 | 214 … | } |
216 | 215 … | } |
Built with git-ssb-web