]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/helpers/webfinger.ts
Fetch video likes/dislikes too
[github/Chocobozzz/PeerTube.git] / server / helpers / webfinger.ts
index 31417e72883469d31d904ddcba2d63b72d2b003a..a5b4785feb17e8ecaa1015959c161cf638704a68 100644 (file)
@@ -1,9 +1,9 @@
 import * as WebFinger from 'webfinger.js'
+import { WebFingerData } from '../../shared'
+import { fetchRemoteAccount } from '../lib/activitypub/account'
 
 import { isTestInstance } from './core-utils'
 import { isActivityPubUrlValid } from './custom-validators'
-import { WebFingerData } from '../../shared'
-import { fetchRemoteAccountAndCreateServer } from './activitypub'
 
 const webfinger = new WebFinger({
   webfist_fallback: false,
@@ -22,10 +22,10 @@ async function getAccountFromWebfinger (nameWithHost: string) {
     throw new Error('Cannot find self link or href is not a valid URL.')
   }
 
-  const res = await fetchRemoteAccountAndCreateServer(selfLink.href)
-  if (res === undefined) throw new Error('Cannot fetch and create server of remote account ' + selfLink.href)
+  const account = await fetchRemoteAccount(selfLink.href)
+  if (account === undefined) throw new Error('Cannot fetch remote account ' + selfLink.href)
 
-  return res.account
+  return account
 }
 
 // ---------------------------------------------------------------------------