git ssb

30+

cel / git-ssb-web



Commit 8a06021c8e2887b1f6bcb31c9fe4a835c7d2f7b5

Merge upstream 1.16.0

Ev Bogue committed on 7/13/2016, 4:15:44 PM
Parent: 4b7fe8493fa89039404fac7dbeb5ff3a5326686b
Parent: d21f79c0d8374b63d422809315b53a082ee0b6cf

Files changed

lib/about.jschanged
lib/votes.jschanged
package.jsonchanged
lib/about.jsView
@@ -57,8 +57,15 @@
5757 rel: 'about',
5858 values: true,
5959 reverse: true
6060 }),
61 + // If that isn't enough, then get About info from other feeds
62 + sbot.links({
63 + dest: target,
64 + rel: 'about',
65 + values: true,
66 + reverse: true
67 + }),
6168 ]),
6269 pull.filter(function (msg) {
6370 return msg && msg.value && msg.value.content
6471 }),
@@ -81,22 +88,28 @@
8188 sbot.links({
8289 dest: target,
8390 rel: 'about',
8491 live: true,
92 + old: false,
8593 values: true,
86- gte: Date.now()
8794 }),
8895 pull.drain(function (msg) {
8996 if (!msg.value) return
9097 var c = msg.value.content
98 + if (!c) return
9199 if (msg.value.author == source || msg.value.author == owner) {
92100 // TODO: give about from source (self) priority over about from owner
93101 if (c.name)
94102 info.name = c.name
95103 if (c.image)
96104 info.image = c.image.link
105 + } else {
106 + if (c.name && !info.name)
107 + info.name = c.name
108 + if (c.image && !info.image)
109 + info.image = c.image.link
97110 }
98111 }, function (err) {
99- if (err) console.error(err)
112 + if (err) console.error('about', err)
100113 })
101114 )
102115 }
lib/votes.jsView
@@ -13,34 +13,19 @@
1313 upvotes: 0,
1414 downvotes: 0
1515 }
1616
17- var opts = {
18- dest: id,
19- rel: 'vote',
20- values: true,
21- keys: false
22- }
2317 pull(
24- sbot.links(opts),
18 + sbot.links({dest: id, rel: 'vote', values: true, live: true}),
2519 pull.drain(processMsg, function (err) {
26- if (err) return cb(err)
27- cb(null, result)
28- // keep the result updated
29- opts.live = true
30- opts.gte = Date.now()
31- pull(
32- sbot.links(opts),
33- pull.drain(processMsg, function (err) {
34- if (err) console.error('votes', err)
35- })
36- )
20 + if (err) console.error('vote', err)
3721 })
3822 )
3923
4024 function processMsg(msg) {
41- if (!msg || !msg.value) return
25 + if (!msg) return
4226 if (msg.sync) return cb(null, result)
27 + if (!msg.value) return
4328 var vote = ((msg.value.content || 0).vote || 0).value
4429 var author = msg.value.author
4530
4631 // remove old vote, if any
package.jsonView
@@ -1,12 +1,12 @@
11 {
22 "name": "git-ssb-web",
3- "version": "1.15.3",
3 + "version": "1.16.0",
44 "description": "web server for browsing git repos on ssb",
55 "bin": "server.js",
66 "dependencies": {
77 "asyncmemo": "^0.1.0",
8- "diff": "^2.2.2",
8 + "diff": "^2.2.3",
99 "highlight.js": "^9.2.0",
1010 "mime-types": "^2.1.11",
1111 "multicb": "^1.2.1",
1212 "node-polyglot": "^1.0.0",
@@ -18,18 +18,18 @@
1818 "pull-paramap": "^1.1.6",
1919 "pull-stream": "^3.1.0",
2020 "ssb-client": "^3.0.1",
2121 "ssb-config": "^1.1.0",
22- "ssb-git-repo": "^1.7.0",
23- "ssb-issues": "^0.1.1",
22 + "ssb-git-repo": "^1.8.0",
23 + "ssb-issues": "^0.1.4",
2424 "ssb-keys": "^5.0.0",
2525 "ssb-marked": "^0.6.0",
2626 "ssb-mentions": "^0.1.0",
2727 "ssb-msg-schemas": "^6.1.0",
28- "ssb-pull-requests": "~0.0.3",
28 + "ssb-pull-requests": "^0.0.4",
2929 "ssb-reconnect": "^0.1.0",
3030 "ssb-ref": "^2.2.2",
31- "stream-to-pull-stream": "^1.6.6"
31 + "stream-to-pull-stream": "^1.7.0"
3232 },
3333 "homepage": "http://git-ssb.celehner.com/%25q5d5Du%2B9WkaSdjc8aJPZm%2BjMrqgo0tmfR%2BRcX5ZZ6H4%3D.sha256",
3434 "repository": {
3535 "type": "git",

Built with git-ssb-web