diff options
Diffstat (limited to 'client/src/app/shared')
-rw-r--r-- | client/src/app/shared/account/account.model.ts | 2 | ||||
-rw-r--r-- | client/src/app/shared/actor/actor.model.ts | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/client/src/app/shared/account/account.model.ts b/client/src/app/shared/account/account.model.ts index c5cd2051c..61f09fc06 100644 --- a/client/src/app/shared/account/account.model.ts +++ b/client/src/app/shared/account/account.model.ts | |||
@@ -5,6 +5,7 @@ export class Account extends Actor implements ServerAccount { | |||
5 | displayName: string | 5 | displayName: string |
6 | description: string | 6 | description: string |
7 | nameWithHost: string | 7 | nameWithHost: string |
8 | nameWithHostForced: string | ||
8 | mutedByUser: boolean | 9 | mutedByUser: boolean |
9 | mutedByInstance: boolean | 10 | mutedByInstance: boolean |
10 | mutedServerByUser: boolean | 11 | mutedServerByUser: boolean |
@@ -19,6 +20,7 @@ export class Account extends Actor implements ServerAccount { | |||
19 | this.description = hash.description | 20 | this.description = hash.description |
20 | this.userId = hash.userId | 21 | this.userId = hash.userId |
21 | this.nameWithHost = Actor.CREATE_BY_STRING(this.name, this.host) | 22 | this.nameWithHost = Actor.CREATE_BY_STRING(this.name, this.host) |
23 | this.nameWithHostForced = Actor.CREATE_BY_STRING(this.name, this.host, true) | ||
22 | 24 | ||
23 | this.mutedByUser = false | 25 | this.mutedByUser = false |
24 | this.mutedByInstance = false | 26 | this.mutedByInstance = false |
diff --git a/client/src/app/shared/actor/actor.model.ts b/client/src/app/shared/actor/actor.model.ts index 5a517c975..285f71ce0 100644 --- a/client/src/app/shared/actor/actor.model.ts +++ b/client/src/app/shared/actor/actor.model.ts | |||
@@ -23,11 +23,11 @@ export abstract class Actor implements ActorServer { | |||
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 | 25 | ||
26 | static CREATE_BY_STRING (accountName: string, host: string) { | 26 | static CREATE_BY_STRING (accountName: string, host: string, forceHostname = false) { |
27 | const absoluteAPIUrl = getAbsoluteAPIUrl() | 27 | const absoluteAPIUrl = getAbsoluteAPIUrl() |
28 | const thisHost = new URL(absoluteAPIUrl).host | 28 | const thisHost = new URL(absoluteAPIUrl).host |
29 | 29 | ||
30 | if (host.trim() === thisHost) return accountName | 30 | if (host.trim() === thisHost && !forceHostname) return accountName |
31 | 31 | ||
32 | return accountName + '@' + host | 32 | return accountName + '@' + host |
33 | } | 33 | } |