aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/account/account.model.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/shared/account/account.model.ts')
-rw-r--r--client/src/app/shared/account/account.model.ts9
1 files changed, 9 insertions, 0 deletions
diff --git a/client/src/app/shared/account/account.model.ts b/client/src/app/shared/account/account.model.ts
index 1dce0003c..dffca783b 100644
--- a/client/src/app/shared/account/account.model.ts
+++ b/client/src/app/shared/account/account.model.ts
@@ -22,4 +22,13 @@ export class Account implements ServerAccount {
22 22
23 return window.location.origin + '/client/assets/images/default-avatar.png' 23 return window.location.origin + '/client/assets/images/default-avatar.png'
24 } 24 }
25
26 static CREATE_BY_STRING (accountName: string, host: string) {
27 const absoluteAPIUrl = getAbsoluteAPIUrl()
28 const thisHost = new URL(absoluteAPIUrl).host
29
30 if (host.trim() === thisHost) return accountName
31
32 return accountName + '@' + host
33 }
25} 34}