git ssb

10+

Matt McKegg / patchwork



Commit 702311acccdb404b47764737d8dbc680fb5ded24

clean up some old stuff

Matt McKegg committed on 4/23/2017, 1:01:49 AM
Parent: ead5d15c75ce6e84eb01e6e0f16ba10e3552d905

Files changed

modules/page/html/render/channel.jschanged
modules/page/html/render/public.jschanged
modules/page/html/render/channel.jsView
@@ -20,9 +20,9 @@
2020 var channel = path.substr(1)
2121 var subscribedChannels = api.channel.obs.subscribed(api.keys.sync.id())
2222
2323 var prepend = [
24- h('div', {className: 'PageHeading'}, [
24 + h('PageHeading', [
2525 h('h1', `#${channel}`),
2626 h('div.meta', [
2727 when(subscribedChannels.has(channel),
2828 h('a.ToggleButton.-unsubscribe', {
modules/page/html/render/public.jsView
@@ -51,18 +51,8 @@
5151 var connectedPeers = api.sbot.obs.connectedPeers()
5252 var localPeers = api.sbot.obs.localPeers()
5353 var connectedPubs = computed([connectedPeers, localPeers], (c, l) => c.filter(x => !l.includes(x)))
5454
55- var oldest = Date.now() - (2 * 24 * 60 * 60e3)
56- getFirstMessage(id, (_, msg) => {
57- if (msg) {
58- // fall back to timestamp stream before this, give 48 hrs for feeds to stabilize
59- if (msg.value.timestamp > oldest) {
60- oldest = Date.now()
61- }
62- }
63- })
64-
6555 var prepend = [
6656 api.message.html.compose({ meta: { type: 'post' }, placeholder: 'Write a public message' })
6757 ]
6858
@@ -71,9 +61,9 @@
7161 waitFor: computed([
7262 following.sync,
7363 subscribedChannels.sync
7464 ], (...x) => x.every(Boolean)),
75- windowSize: 500,
65 + windowSize: 1000,
7666 filter: (item) => {
7767 return !item.boxed && (item.lastUpdateType !== 'post' || item.message) && (
7868 id === item.author ||
7969 (item.author && following().has(item.author)) ||
@@ -219,9 +209,9 @@
219209 ]
220210 }
221211
222212 function getFeed (opts) {
223- if (opts.lt && opts.lt < oldest) {
213 + if (opts.lt) {
224214 opts = extend(opts, {lt: parseInt(opts.lt, 10)})
225215 }
226216
227217 return pull(
@@ -230,24 +220,8 @@
230220 if (msg.sync) return msg
231221 return {key: msg.key, value: msg.value, timestamp: msg.value.timestamp}
232222 })
233223 )
234-
235- // if (opts.lt && opts.lt < oldest) {
236- // opts = extend(opts, {lt: parseInt(opts.lt, 10)})
237- // return pull(
238- // api.sbot.pull.feed(opts),
239- // pull.map((msg) => {
240- // if (msg.sync) {
241- // return msg
242- // } else {
243- // return {key: msg.key, value: msg.value, timestamp: msg.value.timestamp}
244- // }
245- // })
246- // )
247- // } else {
248- // return api.sbot.pull.log(opts)
249- // }
250224 }
251225
252226 function getFirstMessage (feedId, cb) {
253227 api.sbot.pull.userFeed({id: feedId, gte: 0, limit: 1})(null, cb)

Built with git-ssb-web