Commit 1e823ee46587238b719751949108da048d09e777
use backlinks again for mentions
Ev Bogue committed on 6/24/2018, 4:48:57 PMParent: db6cdcd156094888421ebee4c4180af5e0a0a461
Files changed
bin.js | changed |
index.js | changed |
package-lock.json | changed |
package.json | changed |
scuttlebot.js | changed |
views.js | changed |
bin.js | ||
---|---|---|
@@ -31,8 +31,9 @@ | ||
31 | 31 | .use(require('scuttlebot/plugins/gossip')) |
32 | 32 | .use(require('scuttlebot/plugins/replicate')) |
33 | 33 | .use(require('ssb-friends')) |
34 | 34 | .use(require('ssb-blobs')) |
35 | + .use(require('ssb-backlinks')) | |
35 | 36 | .use(require('ssb-query')) |
36 | 37 | .use(require('ssb-links')) |
37 | 38 | .use(require('ssb-ebt')) |
38 | 39 | .use(require('scuttlebot/plugins/invite')) |
index.js | ||
---|---|---|
@@ -30,8 +30,9 @@ | ||
30 | 30 | } |
31 | 31 | } |
32 | 32 | })), |
33 | 33 | h('li', h('a', {href: '#' }, 'All')), |
34 | + h('li', h('a', {href: '#mentions' }, 'Mentions')), | |
34 | 35 | h('li', h('a', {href: '#key' }, 'Key')), |
35 | 36 | h('li.right', h('a', {href: '#about'}, '?')) |
36 | 37 | ) |
37 | 38 | ) |
package-lock.json | ||
---|---|---|
The diff is too large to show. Use a local git client to view these changes. Old file size: 199530 bytes New file size: 38021 bytes |
package.json | ||
---|---|---|
@@ -37,8 +37,9 @@ | ||
37 | 37 | "scuttlebot": "^11.3.0", |
38 | 38 | "simple-mime": "^0.1.0", |
39 | 39 | "split-buffer": "^1.0.0", |
40 | 40 | "ssb-avatar": "^0.2.0", |
41 | + "ssb-backlinks": "^0.7.1", | |
41 | 42 | "ssb-blobs": "^1.1.5", |
42 | 43 | "ssb-client": "^4.5.7", |
43 | 44 | "ssb-ebt": "^5.1.5", |
44 | 45 | "ssb-feed": "^2.3.0", |
scuttlebot.js | ||
---|---|---|
@@ -64,8 +64,11 @@ | ||
64 | 64 | CACHE[e.key] = CACHE[e.key] || e.value |
65 | 65 | }) |
66 | 66 | ) |
67 | 67 | }), |
68 | + backlinks: rec.source(function (query) { | |
69 | + return sbot.backlinks.read(query) | |
70 | + }), | |
68 | 71 | query: rec.source(function (query) { |
69 | 72 | return sbot.query.read(query) |
70 | 73 | }), |
71 | 74 | get: rec.async(function (key, cb) { |
views.js | ||
---|---|---|
@@ -29,9 +29,9 @@ | ||
29 | 29 | |
30 | 30 | screen.appendChild(hyperscroll(content)) |
31 | 31 | } |
32 | 32 | |
33 | -/*var mentionsStream = function () { | |
33 | +var mentionsStream = function () { | |
34 | 34 | var content = h('div.content') |
35 | 35 | |
36 | 36 | var screen = document.getElementById('screen') |
37 | 37 | |
@@ -40,8 +40,9 @@ | ||
40 | 40 | function createStream (opts) { |
41 | 41 | return pull( |
42 | 42 | Next(sbot.backlinks, opts, ['value', 'timestamp']), |
43 | 43 | pull.map(function (msg) { |
44 | + if (msg.value.private == true) return | |
44 | 45 | return render(msg) |
45 | 46 | }) |
46 | 47 | ) |
47 | 48 | } |
@@ -49,8 +50,9 @@ | ||
49 | 50 | pull( |
50 | 51 | createStream({ |
51 | 52 | limit: 10, |
52 | 53 | reverse: true, |
54 | + index: 'DTA', | |
53 | 55 | live: false, |
54 | 56 | query: [{$filter: {dest: id}}] |
55 | 57 | }), |
56 | 58 | stream.bottom(content) |
@@ -59,14 +61,15 @@ | ||
59 | 61 | pull( |
60 | 62 | createStream({ |
61 | 63 | limit: 10, |
62 | 64 | old: false, |
65 | + index: 'DTA', | |
63 | 66 | live: true, |
64 | 67 | query: [{$filter: {dest: id}}] |
65 | 68 | }), |
66 | 69 | stream.top(content) |
67 | 70 | ) |
68 | -}*/ | |
71 | +} | |
69 | 72 | |
70 | 73 | var userStream = function (src) { |
71 | 74 | var content = h('div.content') |
72 | 75 | var screen = document.getElementById('screen') |
@@ -267,10 +270,10 @@ | ||
267 | 270 | if (ref.isFeed(src)) { |
268 | 271 | userStream(src) |
269 | 272 | } else if (ref.isMsg(src)) { |
270 | 273 | msgThread(src) |
271 | - //} else if (src == 'queue') { | |
272 | - // mentionsStream() | |
274 | + } else if (src == 'mentions') { | |
275 | + mentionsStream() | |
273 | 276 | } else if (src == 'about') { |
274 | 277 | about() |
275 | 278 | } else if (src == 'edit') { |
276 | 279 | edit() |
Built with git-ssb-web