Commit 14f790fb7e7f37a2f2427d5587b29c83e420986b
experiment with only using provided timestamps rather than sync time for public feed ordering
Matt McKegg committed on 4/7/2017, 7:42:23 AMParent: 0451703ba7a81e3790d83f8b1f67c50f96392836
Files changed
modules/page/html/render/public.js | changed |
modules/page/html/render/public.js | ||
---|---|---|
@@ -204,21 +204,33 @@ | ||
204 | 204 | |
205 | 205 | function getFeed (opts) { |
206 | 206 | if (opts.lt && opts.lt < oldest) { |
207 | 207 | opts = extend(opts, {lt: parseInt(opts.lt, 10)}) |
208 | - return pull( | |
209 | - api.sbot.pull.feed(opts), | |
210 | - pull.map((msg) => { | |
211 | - if (msg.sync) { | |
212 | - return msg | |
213 | - } else { | |
214 | - return {key: msg.key, value: msg.value, timestamp: msg.value.timestamp} | |
215 | - } | |
216 | - }) | |
217 | - ) | |
218 | - } else { | |
219 | - return api.sbot.pull.log(opts) | |
220 | 208 | } |
209 | + | |
210 | + return pull( | |
211 | + api.sbot.pull.feed(opts), | |
212 | + pull.map((msg) => { | |
213 | + if (msg.sync) return msg | |
214 | + return {key: msg.key, value: msg.value, timestamp: msg.value.timestamp} | |
215 | + }) | |
216 | + ) | |
217 | + | |
218 | + // if (opts.lt && opts.lt < oldest) { | |
219 | + // opts = extend(opts, {lt: parseInt(opts.lt, 10)}) | |
220 | + // return pull( | |
221 | + // api.sbot.pull.feed(opts), | |
222 | + // pull.map((msg) => { | |
223 | + // if (msg.sync) { | |
224 | + // return msg | |
225 | + // } else { | |
226 | + // return {key: msg.key, value: msg.value, timestamp: msg.value.timestamp} | |
227 | + // } | |
228 | + // }) | |
229 | + // ) | |
230 | + // } else { | |
231 | + // return api.sbot.pull.log(opts) | |
232 | + // } | |
221 | 233 | } |
222 | 234 | |
223 | 235 | function getFirstMessage (feedId, cb) { |
224 | 236 | api.sbot.pull.userFeed({id: feedId, gte: 0, limit: 1})(null, cb) |
Built with git-ssb-web