]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/shared/actor/actor.model.ts
Feature/completeUsernameCopy (#1913)
[github/Chocobozzz/PeerTube.git] / client / src / app / shared / actor / actor.model.ts
index 5a517c975b67e614cd11b012462c40a519d999b9..285f71ce0d1dc3c0627223a3d7fba85ff12b5830 100644 (file)
@@ -23,11 +23,11 @@ export abstract class Actor implements ActorServer {
     return window.location.origin + '/client/assets/images/default-avatar.png'
   }
 
-  static CREATE_BY_STRING (accountName: string, host: string) {
+  static CREATE_BY_STRING (accountName: string, host: string, forceHostname = false) {
     const absoluteAPIUrl = getAbsoluteAPIUrl()
     const thisHost = new URL(absoluteAPIUrl).host
 
-    if (host.trim() === thisHost) return accountName
+    if (host.trim() === thisHost && !forceHostname) return accountName
 
     return accountName + '@' + host
   }