git ssb

30+

cel / git-ssb-web



Commit 37ce8bccebec917257a650d3328c37f3dbd6cff7

Use links instead of log to render feed

Charles Lehner committed on 2/28/2016, 4:41:15 AM
Parent: 88eec92c154cb3894b4a853ba05d69069267687a

Files changed

index.jschanged
index.jsView
@@ -186,33 +186,28 @@
186186
187187 /* Feed */
188188
189189 function renderFeed(feedId) {
190- var opts = {
191- reverse: true,
192- id: feedId,
193- limit: 100,
194- }
195190 return pull(
196- feedId ? ssb.createUserStream(opts) : ssb.createLogStream(opts),
197- pull.filter(function (msg) {
198- return msg.value.content.type in msgTypes
191+ ssb.links({
192+ reverse: true,
193+ rel: 'repo',
194+ source: feedId,
195+ values: true
199196 }),
200- pull.asyncMap(function (msg, cb) {
201- switch (msg.value.content.type) {
202- case 'git-repo': return renderRepoCreated(msg, cb)
203- case 'git-update': return renderUpdate(msg, cb)
204- }
205- })
197+ pull.take(20),
198+ pull.asyncMap(renderUpdate)
206199 )
207200 }
208201
202+ /*
209203 function renderRepoCreated(msg, cb) {
210204 var repoLink = link([msg.key])
211205 var authorLink = link([msg.value.author])
212206 cb(null, '<p>' + timestamp(msg.value.timestamp) + '<br>' +
213207 authorLink + ' created repo ' + repoLink + '</p>')
214208 }
209+ */
215210
216211 function renderUpdate(msg, cb) {
217212 about.getName(msg.value.author, function (err, name) {
218213 if (err) return cb(err)

Built with git-ssb-web