diff options
author | cel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519> | 2017-06-12 13:55:42 -1000 |
---|---|---|
committer | cel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519> | 2017-06-12 14:04:08 -1000 |
commit | 631791d5345cbc1c29fc844d5785139dff746958 (patch) | |
tree | 7589eb83b0314ad4b0afb78affe771aa3fb7b07c /lib/app.js | |
parent | 0fec67a93d8af9fa888051aa3c087d50d80cb079 (diff) | |
download | patchfoo-631791d5345cbc1c29fc844d5785139dff746958.tar.gz patchfoo-631791d5345cbc1c29fc844d5785139dff746958.zip |
Add mentions page using ssb-backlinks
Diffstat (limited to 'lib/app.js')
-rw-r--r-- | lib/app.js | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -501,3 +501,23 @@ App.prototype.streamChannel = function (opts) { return pull.error(new Error( 'Viewing channels/tags requires the ssb-backlinks or ssb-query plugin')) } + +App.prototype.streamMentions = function (opts) { + if (!this.sbot.backlinks) return pull.error(new Error( + 'Viewing mentions requires the ssb-backlinks plugin')) + + if (this.sbot.backlinks) return this.sbot.backlinks.read(u.mergeOpts(opts, { + query: [{$filter: { + dest: this.sbot.id, + value: { + content: { + type: 'post' + } + }, + timestamp: { + $gt: opts.gt, + $lt: opts.lt, + } + }}] + })) +} |