Commit 8a06021c8e2887b1f6bcb31c9fe4a835c7d2f7b5
Merge upstream 1.16.0
Ev Bogue committed on 7/13/2016, 4:15:44 PMParent: 4b7fe8493fa89039404fac7dbeb5ff3a5326686b
Parent: d21f79c0d8374b63d422809315b53a082ee0b6cf
Files changed
lib/about.js | changed |
lib/votes.js | changed |
package.json | changed |
lib/about.js | ||
---|---|---|
@@ -57,8 +57,15 @@ | ||
57 | 57 … | rel: 'about', |
58 | 58 … | values: true, |
59 | 59 … | reverse: true |
60 | 60 … | }), |
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 … | + }), | |
61 | 68 … | ]), |
62 | 69 … | pull.filter(function (msg) { |
63 | 70 … | return msg && msg.value && msg.value.content |
64 | 71 … | }), |
@@ -81,22 +88,28 @@ | ||
81 | 88 … | sbot.links({ |
82 | 89 … | dest: target, |
83 | 90 … | rel: 'about', |
84 | 91 … | live: true, |
92 … | + old: false, | |
85 | 93 … | values: true, |
86 | - gte: Date.now() | |
87 | 94 … | }), |
88 | 95 … | pull.drain(function (msg) { |
89 | 96 … | if (!msg.value) return |
90 | 97 … | var c = msg.value.content |
98 … | + if (!c) return | |
91 | 99 … | if (msg.value.author == source || msg.value.author == owner) { |
92 | 100 … | // TODO: give about from source (self) priority over about from owner |
93 | 101 … | if (c.name) |
94 | 102 … | info.name = c.name |
95 | 103 … | if (c.image) |
96 | 104 … | 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 | |
97 | 110 … | } |
98 | 111 … | }, function (err) { |
99 | - if (err) console.error(err) | |
112 … | + if (err) console.error('about', err) | |
100 | 113 … | }) |
101 | 114 … | ) |
102 | 115 … | } |
lib/votes.js | ||
---|---|---|
@@ -13,34 +13,19 @@ | ||
13 | 13 … | upvotes: 0, |
14 | 14 … | downvotes: 0 |
15 | 15 … | } |
16 | 16 … | |
17 | - var opts = { | |
18 | - dest: id, | |
19 | - rel: 'vote', | |
20 | - values: true, | |
21 | - keys: false | |
22 | - } | |
23 | 17 … | pull( |
24 | - sbot.links(opts), | |
18 … | + sbot.links({dest: id, rel: 'vote', values: true, live: true}), | |
25 | 19 … | 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) | |
37 | 21 … | }) |
38 | 22 … | ) |
39 | 23 … | |
40 | 24 … | function processMsg(msg) { |
41 | - if (!msg || !msg.value) return | |
25 … | + if (!msg) return | |
42 | 26 … | if (msg.sync) return cb(null, result) |
27 … | + if (!msg.value) return | |
43 | 28 … | var vote = ((msg.value.content || 0).vote || 0).value |
44 | 29 … | var author = msg.value.author |
45 | 30 … | |
46 | 31 … | // remove old vote, if any |
package.json | ||
---|---|---|
@@ -1,12 +1,12 @@ | ||
1 | 1 … | { |
2 | 2 … | "name": "git-ssb-web", |
3 | - "version": "1.15.3", | |
3 … | + "version": "1.16.0", | |
4 | 4 … | "description": "web server for browsing git repos on ssb", |
5 | 5 … | "bin": "server.js", |
6 | 6 … | "dependencies": { |
7 | 7 … | "asyncmemo": "^0.1.0", |
8 | - "diff": "^2.2.2", | |
8 … | + "diff": "^2.2.3", | |
9 | 9 … | "highlight.js": "^9.2.0", |
10 | 10 … | "mime-types": "^2.1.11", |
11 | 11 … | "multicb": "^1.2.1", |
12 | 12 … | "node-polyglot": "^1.0.0", |
@@ -18,18 +18,18 @@ | ||
18 | 18 … | "pull-paramap": "^1.1.6", |
19 | 19 … | "pull-stream": "^3.1.0", |
20 | 20 … | "ssb-client": "^3.0.1", |
21 | 21 … | "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", | |
24 | 24 … | "ssb-keys": "^5.0.0", |
25 | 25 … | "ssb-marked": "^0.6.0", |
26 | 26 … | "ssb-mentions": "^0.1.0", |
27 | 27 … | "ssb-msg-schemas": "^6.1.0", |
28 | - "ssb-pull-requests": "~0.0.3", | |
28 … | + "ssb-pull-requests": "^0.0.4", | |
29 | 29 … | "ssb-reconnect": "^0.1.0", |
30 | 30 … | "ssb-ref": "^2.2.2", |
31 | - "stream-to-pull-stream": "^1.6.6" | |
31 … | + "stream-to-pull-stream": "^1.7.0" | |
32 | 32 … | }, |
33 | 33 … | "homepage": "http://git-ssb.celehner.com/%25q5d5Du%2B9WkaSdjc8aJPZm%2BjMrqgo0tmfR%2BRcX5ZZ6H4%3D.sha256", |
34 | 34 … | "repository": { |
35 | 35 … | "type": "git", |
Built with git-ssb-web