Something like @toto@example.com
const isURISearch = search.startsWith('http://') || search.startsWith('https://')
const parts = search.split('@')
+
+ // Handle strings like @toto@example.com
+ if (parts.length === 3 && parts[0].length === 0) parts.shift()
const isWebfingerSearch = parts.length === 2 && parts.every(p => p.indexOf(' ') === -1)
if (isURISearch || isWebfingerSearch) return searchVideoChannelURI(search, isWebfingerSearch, res)
request_timeout: 3000
})
-async function loadActorUrlOrGetFromWebfinger (uri: string) {
+async function loadActorUrlOrGetFromWebfinger (uriArg: string) {
+ // Handle strings like @toto@example.com
+ const uri = uriArg.startsWith('@') ? uriArg.slice(1) : uriArg
+
const [ name, host ] = uri.split('@')
let actor: ActorModel