Commit 5aa798d79976877077d73285debd83d7843f9482
Show repo forks in feed
Charles Lehner committed on 4/4/2016, 10:49:05 PMParent: 6839527655b266fe0e7ea9e840a892514428e492
Files changed
index.js | changed |
index.js | ||
---|---|---|
@@ -804,14 +804,25 @@ | ||
804 | 804 | var author = msg.value.author |
805 | 805 | var authorLink = link([msg.value.author], msg.authorName) |
806 | 806 | switch (c.type) { |
807 | 807 | case 'git-repo': |
808 | - return getRepoName(about, author, msg.key, function (err, repoName) { | |
809 | - if (err) return cb(err) | |
810 | - var repoLink = link([msg.key], repoName) | |
811 | - cb(null, '<section class="collapse">' + msgLink + '<br>' + | |
812 | - authorLink + ' created repo ' + repoLink + '</section>') | |
813 | - }) | |
808 | + var done = multicb({ pluck: 1, spread: true }) | |
809 | + getRepoName(about, author, msg.key, done()) | |
810 | + if (c.upstream) { | |
811 | + getRepoName(about, author, c.upstream, done()) | |
812 | + return done(function (err, repoName, upstreamName) { | |
813 | + cb(null, '<section class="collapse">' + msgLink + '<br>' + | |
814 | + authorLink + ' forked ' + link([c.upstream], upstreamName) + | |
815 | + ' to ' + link([msg.key], repoName) + '</section>') | |
816 | + }) | |
817 | + } else { | |
818 | + return done(function (err, repoName) { | |
819 | + if (err) return cb(err) | |
820 | + var repoLink = link([msg.key], repoName) | |
821 | + cb(null, '<section class="collapse">' + msgLink + '<br>' + | |
822 | + authorLink + ' created repo ' + repoLink + '</section>') | |
823 | + }) | |
824 | + } | |
814 | 825 | case 'git-update': |
815 | 826 | return getRepoName(about, author, c.repo, function (err, repoName) { |
816 | 827 | if (err) return cb(err) |
817 | 828 | var repoLink = link([c.repo], repoName) |
Built with git-ssb-web