git ssb

16+

cel / patchfoo



Commit 47dda2fa1ff7e9e2cc281278bf33e79e46a38873

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
cel committed on 6/14/2017, 5:36:58 AM
Parent: 5f652a26f033d4de982ba32407455dd011a6f056

Files changed

lib/app.jschanged
lib/app.jsView
@@ -472,12 +472,21 @@
472472 )
473473 }
474474
475475 App.prototype.filter = function (plugin, opts, filter) {
476 + // work around flumeview-query not picking the best index.
477 + // %b+QdyLFQ21UGYwvV3AiD8FEr7mKlB8w9xx3h8WzSUb0=.sha256
478 + var index
479 + if (plugin === this.sbot.backlinks) {
480 + var c = filter && filter.value && filter.value.content
481 + var filteringByType = c && c.type
482 + if (!filteringByType) index = 'DTS'
483 + }
476484 // work around flumeview-query not supporting $lt/$gt.
477485 // %FCIv0D7JQyERznC18p8Dc1KtN6SLeJAl1sR5DAIr/Ek=.sha256
478486 return pull(
479487 plugin.read({
488 + index: index,
480489 reverse: opts.reverse,
481490 limit: opts.limit && (opts.limit + 1),
482491 query: [{$filter: u.mergeOpts(filter, {
483492 timestamp: {
@@ -496,14 +505,8 @@
496505 App.prototype.streamChannel = function (opts) {
497506 // prefer ssb-backlinks to ssb-query because it also handles hashtag mentions
498507 if (this.sbot.backlinks) return this.filter(this.sbot.backlinks, opts, {
499508 dest: '#' + opts.channel,
500- value: {
501- // filter by message type to work around %b+QdyLFQ21UGYwvV3AiD8FEr7mKlB8w9xx3h8WzSUb0=.sha256
502- content: {
503- type: 'post'
504- }
505- }
506509 })
507510
508511 if (this.sbot.query) return this.filter(this.sbot.query, opts, {
509512 value: {content: {channel: opts.channel}},
@@ -518,14 +521,8 @@
518521 'Viewing mentions requires the ssb-backlinks plugin'))
519522
520523 if (this.sbot.backlinks) return this.filter(this.sbot.backlinks, opts, {
521524 dest: this.sbot.id,
522- value: {
523- // filter by message type to work around %b+QdyLFQ21UGYwvV3AiD8FEr7mKlB8w9xx3h8WzSUb0=.sha256
524- content: {
525- type: 'post'
526- }
527- }
528525 })
529526 }
530527
531528 App.prototype.streamPrivate = function (opts) {

Built with git-ssb-web