aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorcel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2018-07-08 16:30:08 -1000
committercel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2018-07-08 16:30:08 -1000
commit09f70e5f94777bbe5a18d2980ca221360642a970 (patch)
tree00aed8c9559e1f329b599de535faca2c8ac921c4 /lib
parentbf146b14e02f6e1188a8c37b70a29f882f0c75e1 (diff)
downloadpatchfoo-09f70e5f94777bbe5a18d2980ca221360642a970.tar.gz
patchfoo-09f70e5f94777bbe5a18d2980ca221360642a970.zip
Support ssb-search
Diffstat (limited to 'lib')
-rw-r--r--lib/app.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/app.js b/lib/app.js
index ca9b6b2..b63a13e 100644
--- a/lib/app.js
+++ b/lib/app.js
@@ -123,9 +123,11 @@ App.prototype.unboxMsg = function (msg, cb) {
}
App.prototype.search = function (opts) {
- var search = this.sbot.fulltext && this.sbot.fulltext.search
- if (!search) return pull.error(new Error('Missing fulltext search plugin'))
- return search(opts)
+ var fsearch = this.sbot.fulltext && this.sbot.fulltext.search
+ if (fsearch) return fsearch(opts)
+ var search = this.sbot.search && this.sbot.search.query
+ if (search) return search({query: opts})
+ return pull.error(new Error('Search needs ssb-fulltext or ssb-search plugin'))
}
App.prototype.advancedSearch = function (opts) {