From 00472915a4fb29399109ec9c088ab1e6a3f9b0ec Mon Sep 17 00:00:00 2001 From: cel Date: Thu, 14 Sep 2017 08:46:07 -1000 Subject: Render npm-packages --- lib/app.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'lib/app.js') diff --git a/lib/app.js b/lib/app.js index afa914f..3255851 100644 --- a/lib/app.js +++ b/lib/app.js @@ -545,3 +545,21 @@ App.prototype.streamPrivate = function (opts) { pull.take(opts.limit) ) } + +App.prototype.blobMentions = function (opts) { + if (!this.sbot.links2) return pull.error(new Error( + 'missing ssb-links plugin')) + return this.sbot.links2.read({ + query: [ + {$filter: {rel: ['mentions', opts.name]}}, + {$filter: {dest: {$prefix: '&'}}}, + {$map: { + name: ['rel', 1], + size: ['rel', 2], + link: 'dest', + author: 'source', + time: 'ts' + }} + ] + }) +} -- cgit v1.2.3