From 891dd8e960425e52c64fecf78668cd115d9251f7 Mon Sep 17 00:00:00 2001 From: cel Date: Wed, 27 May 2020 15:23:23 -0400 Subject: Support channel prefixes (wildcard) --- lib/app.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'lib/app.js') diff --git a/lib/app.js b/lib/app.js index b312506..814bfb6 100644 --- a/lib/app.js +++ b/lib/app.js @@ -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( -- cgit v1.2.3