aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorcel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2017-06-13 19:32:59 -1000
committercel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2017-06-13 19:36:58 -1000
commit47dda2fa1ff7e9e2cc281278bf33e79e46a38873 (patch)
tree9d7a44b991607132f790f9f667bf5718248912b9 /lib
parent5f652a26f033d4de982ba32407455dd011a6f056 (diff)
downloadpatchfoo-47dda2fa1ff7e9e2cc281278bf33e79e46a38873.tar.gz
patchfoo-47dda2fa1ff7e9e2cc281278bf33e79e46a38873.zip
Specify backlinks index manually
as mentioned in %CoRaVRWYmwF/ywtUqqBBb4P9N8zDn+JltO9t1FQJaHE=.sha256, to allow showing all message types in backlinks streams (channels, mentions), which was said to be not possible in %hn7lMbo+MNhb4I/M+tGPEZmMbQKb/N0DnSUzSrYCA28=.sha256. This requires ssb-backlinks v0.2.0 %HH16c+LOnvotjwXtQi4JuG9OV2lf7vREmsOnseQmlVA=.sha256
Diffstat (limited to 'lib')
-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'
- }
- }
})
}