diff options
author | cel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519> | 2018-07-08 16:30:08 -1000 |
---|---|---|
committer | cel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519> | 2018-07-08 16:30:08 -1000 |
commit | 09f70e5f94777bbe5a18d2980ca221360642a970 (patch) | |
tree | 00aed8c9559e1f329b599de535faca2c8ac921c4 | |
parent | bf146b14e02f6e1188a8c37b70a29f882f0c75e1 (diff) | |
download | patchfoo-09f70e5f94777bbe5a18d2980ca221360642a970.tar.gz patchfoo-09f70e5f94777bbe5a18d2980ca221360642a970.zip |
Support ssb-search
-rw-r--r-- | lib/app.js | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -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) { |