git ssb

30+

cel / git-ssb-web



Commit e79a1c8ddcfc1950835039e14b72f92377eed48a

Use feed stream instead of log stream for global feed view

Sort updates by timestamp and filter out ones with blatantly invalid (future) timestamps
Charles Lehner committed on 3/22/2016, 11:46:24 PM
Parent: fd5a0b93e7509a3157c5767fc08919dfd327aa32

Files changed

index.jschanged
index.jsView
@@ -351,11 +351,12 @@
351351 reverse: true,
352352 id: feedId
353353 }
354354 return pull(
355- feedId ? ssb.createUserStream(opts) : ssb.createLogStream(opts),
355+ feedId ? ssb.createUserStream(opts) : ssb.createFeedStream(opts),
356356 pull.filter(function (msg) {
357- return msg.value.content.type in msgTypes
357+ return msg.value.content.type in msgTypes &&
358+ msg.value.timestamp < Date.now()
358359 }),
359360 pull.take(20),
360361 pull.asyncMap(function (msg, cb) {
361362 about.getName(msg.value.author, function (err, name) {

Built with git-ssb-web