]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/lib/activitypub/follow.ts
Don't notify when transcoding ends on manual run
[github/Chocobozzz/PeerTube.git] / server / lib / activitypub / follow.ts
index c1bd667e04e1def55d048eeca0b5cf4b5aa16a5f..741b54df51be336ab0c988bd72d6d3dfcab4f23d 100644 (file)
@@ -31,6 +31,21 @@ async function autoFollowBackIfNeeded (actorFollow: MActorFollowActors, transact
   }
 }
 
+// If we only have an host, use a default account handle
+function getRemoteNameAndHost (handleOrHost: string) {
+  let name = SERVER_ACTOR_NAME
+  let host = handleOrHost
+
+  const splitted = handleOrHost.split('@')
+  if (splitted.length === 2) {
+    name = splitted[0]
+    host = splitted[1]
+  }
+
+  return { name, host }
+}
+
 export {
-  autoFollowBackIfNeeded
+  autoFollowBackIfNeeded,
+  getRemoteNameAndHost
 }