diff options
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, + } + }}] + })) +} |