diff options
author | cel <cel@lOUVT+Phkvai9a/cCS/RKo+S9hnPAQdVixms/7ldpPA=.ed25519> | 2020-05-27 15:23:23 -0400 |
---|---|---|
committer | cel <cel@lOUVT+Phkvai9a/cCS/RKo+S9hnPAQdVixms/7ldpPA=.ed25519> | 2020-05-27 15:23:23 -0400 |
commit | 891dd8e960425e52c64fecf78668cd115d9251f7 (patch) | |
tree | 745d836b191976c233d959618ccba8f60644aa1f | |
parent | e537f08964e2fcfe94f3777ef75c82f928b65121 (diff) | |
download | patchfoo-891dd8e960425e52c64fecf78668cd115d9251f7.tar.gz patchfoo-891dd8e960425e52c64fecf78668cd115d9251f7.zip |
Support channel prefixes (wildcard)
-rw-r--r-- | lib/app.js | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -874,11 +874,15 @@ App.prototype.filterMessages = function (opts) { 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, + dest: /\*$/.test(opts.channel) + ? {$prefix: '#' + opts.channel.replace(/\*$/, '')} + : '#' + opts.channel }) if (this.sbot.query) return this.filter(this.sbot.query, opts, { - value: {content: {channel: opts.channel}}, + value: {content: {channel: /\*$/.test(opts.channel) + ? {$prefix: opts.channel.replace(/\*$/, '')} + : opts.channel}}, }) return pull.error(new Error( |