git ssb

2+

ev / mvd



Commit 1e823ee46587238b719751949108da048d09e777

use backlinks again for mentions

Ev Bogue committed on 6/24/2018, 4:48:57 PM
Parent: db6cdcd156094888421ebee4c4180af5e0a0a461

Files changed

bin.jschanged
index.jschanged
package-lock.jsonchanged
package.jsonchanged
scuttlebot.jschanged
views.jschanged
bin.jsView
@@ -31,8 +31,9 @@
3131 .use(require('scuttlebot/plugins/gossip'))
3232 .use(require('scuttlebot/plugins/replicate'))
3333 .use(require('ssb-friends'))
3434 .use(require('ssb-blobs'))
35 + .use(require('ssb-backlinks'))
3536 .use(require('ssb-query'))
3637 .use(require('ssb-links'))
3738 .use(require('ssb-ebt'))
3839 .use(require('scuttlebot/plugins/invite'))
index.jsView
@@ -30,8 +30,9 @@
3030 }
3131 }
3232 })),
3333 h('li', h('a', {href: '#' }, 'All')),
34 + h('li', h('a', {href: '#mentions' }, 'Mentions')),
3435 h('li', h('a', {href: '#key' }, 'Key')),
3536 h('li.right', h('a', {href: '#about'}, '?'))
3637 )
3738 )
package-lock.jsonView
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.jsonView
@@ -37,8 +37,9 @@
3737 "scuttlebot": "^11.3.0",
3838 "simple-mime": "^0.1.0",
3939 "split-buffer": "^1.0.0",
4040 "ssb-avatar": "^0.2.0",
41 + "ssb-backlinks": "^0.7.1",
4142 "ssb-blobs": "^1.1.5",
4243 "ssb-client": "^4.5.7",
4344 "ssb-ebt": "^5.1.5",
4445 "ssb-feed": "^2.3.0",
scuttlebot.jsView
@@ -64,8 +64,11 @@
6464 CACHE[e.key] = CACHE[e.key] || e.value
6565 })
6666 )
6767 }),
68 + backlinks: rec.source(function (query) {
69 + return sbot.backlinks.read(query)
70 + }),
6871 query: rec.source(function (query) {
6972 return sbot.query.read(query)
7073 }),
7174 get: rec.async(function (key, cb) {
views.jsView
@@ -29,9 +29,9 @@
2929
3030 screen.appendChild(hyperscroll(content))
3131 }
3232
33-/*var mentionsStream = function () {
33 +var mentionsStream = function () {
3434 var content = h('div.content')
3535
3636 var screen = document.getElementById('screen')
3737
@@ -40,8 +40,9 @@
4040 function createStream (opts) {
4141 return pull(
4242 Next(sbot.backlinks, opts, ['value', 'timestamp']),
4343 pull.map(function (msg) {
44 + if (msg.value.private == true) return
4445 return render(msg)
4546 })
4647 )
4748 }
@@ -49,8 +50,9 @@
4950 pull(
5051 createStream({
5152 limit: 10,
5253 reverse: true,
54 + index: 'DTA',
5355 live: false,
5456 query: [{$filter: {dest: id}}]
5557 }),
5658 stream.bottom(content)
@@ -59,14 +61,15 @@
5961 pull(
6062 createStream({
6163 limit: 10,
6264 old: false,
65 + index: 'DTA',
6366 live: true,
6467 query: [{$filter: {dest: id}}]
6568 }),
6669 stream.top(content)
6770 )
68-}*/
71 +}
6972
7073 var userStream = function (src) {
7174 var content = h('div.content')
7275 var screen = document.getElementById('screen')
@@ -267,10 +270,10 @@
267270 if (ref.isFeed(src)) {
268271 userStream(src)
269272 } else if (ref.isMsg(src)) {
270273 msgThread(src)
271- //} else if (src == 'queue') {
272- // mentionsStream()
274 + } else if (src == 'mentions') {
275 + mentionsStream()
273276 } else if (src == 'about') {
274277 about()
275278 } else if (src == 'edit') {
276279 edit()

Built with git-ssb-web