mirror of https://github.com/Chocobozzz/PeerTube
Fix channel search with complete handle
parent
42cc1887af
commit
93a1e67f86
|
@ -121,7 +121,7 @@ export type SummaryOptions = {
|
||||||
for (const handle of options.handles || []) {
|
for (const handle of options.handles || []) {
|
||||||
const [ preferredUsername, host ] = handle.split('@')
|
const [ preferredUsername, host ] = handle.split('@')
|
||||||
|
|
||||||
if (!host) {
|
if (!host || host === WEBSERVER.HOST) {
|
||||||
or.push({
|
or.push({
|
||||||
'$Actor.preferredUsername$': preferredUsername,
|
'$Actor.preferredUsername$': preferredUsername,
|
||||||
'$Actor.serverId$': null
|
'$Actor.serverId$': null
|
||||||
|
|
|
@ -128,6 +128,13 @@ describe('Test channels search', function () {
|
||||||
expect(body.data[0].displayName).to.equal('Squall channel')
|
expect(body.data[0].displayName).to.equal('Squall channel')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
const body = await command.advancedChannelSearch({ search: { handles: [ 'squall_channel@' + server.host ] } })
|
||||||
|
expect(body.total).to.equal(1)
|
||||||
|
expect(body.data).to.have.lengthOf(1)
|
||||||
|
expect(body.data[0].displayName).to.equal('Squall channel')
|
||||||
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
const body = await command.advancedChannelSearch({ search: { handles: [ 'chocobozzz_channel' ] } })
|
const body = await command.advancedChannelSearch({ search: { handles: [ 'chocobozzz_channel' ] } })
|
||||||
expect(body.total).to.equal(0)
|
expect(body.total).to.equal(0)
|
||||||
|
|
Loading…
Reference in New Issue