aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/app.js21
1 files changed, 9 insertions, 12 deletions
diff --git a/lib/app.js b/lib/app.js
index 873dedd..08a6c6c 100644
--- a/lib/app.js
+++ b/lib/app.js
@@ -473,10 +473,19 @@ App.prototype.streamEmojis = function () {
}
App.prototype.filter = function (plugin, opts, filter) {
+ // work around flumeview-query not picking the best index.
+ // %b+QdyLFQ21UGYwvV3AiD8FEr7mKlB8w9xx3h8WzSUb0=.sha256
+ var index
+ if (plugin === this.sbot.backlinks) {
+ var c = filter && filter.value && filter.value.content
+ var filteringByType = c && c.type
+ if (!filteringByType) index = 'DTS'
+ }
// work around flumeview-query not supporting $lt/$gt.
// %FCIv0D7JQyERznC18p8Dc1KtN6SLeJAl1sR5DAIr/Ek=.sha256
return pull(
plugin.read({
+ index: index,
reverse: opts.reverse,
limit: opts.limit && (opts.limit + 1),
query: [{$filter: u.mergeOpts(filter, {
@@ -497,12 +506,6 @@ App.prototype.streamChannel = function (opts) {
// prefer ssb-backlinks to ssb-query because it also handles hashtag mentions
if (this.sbot.backlinks) return this.filter(this.sbot.backlinks, opts, {
dest: '#' + opts.channel,
- value: {
- // filter by message type to work around %b+QdyLFQ21UGYwvV3AiD8FEr7mKlB8w9xx3h8WzSUb0=.sha256
- content: {
- type: 'post'
- }
- }
})
if (this.sbot.query) return this.filter(this.sbot.query, opts, {
@@ -519,12 +522,6 @@ App.prototype.streamMentions = function (opts) {
if (this.sbot.backlinks) return this.filter(this.sbot.backlinks, opts, {
dest: this.sbot.id,
- value: {
- // filter by message type to work around %b+QdyLFQ21UGYwvV3AiD8FEr7mKlB8w9xx3h8WzSUb0=.sha256
- content: {
- type: 'post'
- }
- }
})
}