diff options
author | Chocobozzz <me@florianbigard.com> | 2020-07-27 11:40:30 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2020-07-31 11:35:19 +0200 |
commit | 94148c9028829b5576a5dcbfba2c7fb9cf6443d3 (patch) | |
tree | 2774f272329111abd03e8441ff936da11fb1a3f3 /client/src/app/shared/shared-main | |
parent | 441e453ae53e491b09c9b09b00b041788176ce64 (diff) | |
download | PeerTube-94148c9028829b5576a5dcbfba2c7fb9cf6443d3.tar.gz PeerTube-94148c9028829b5576a5dcbfba2c7fb9cf6443d3.tar.zst PeerTube-94148c9028829b5576a5dcbfba2c7fb9cf6443d3.zip |
Add abuse messages management in my account
Diffstat (limited to 'client/src/app/shared/shared-main')
-rw-r--r-- | client/src/app/shared/shared-main/account/actor.model.ts | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/client/src/app/shared/shared-main/account/actor.model.ts b/client/src/app/shared/shared-main/account/actor.model.ts index bda88bdee..950e256ff 100644 --- a/client/src/app/shared/shared-main/account/actor.model.ts +++ b/client/src/app/shared/shared-main/account/actor.model.ts | |||
@@ -41,6 +41,13 @@ export abstract class Actor implements ActorServer { | |||
41 | return accountName + '@' + host | 41 | return accountName + '@' + host |
42 | } | 42 | } |
43 | 43 | ||
44 | static IS_LOCAL (host: string) { | ||
45 | const absoluteAPIUrl = getAbsoluteAPIUrl() | ||
46 | const thisHost = new URL(absoluteAPIUrl).host | ||
47 | |||
48 | return host.trim() === thisHost | ||
49 | } | ||
50 | |||
44 | protected constructor (hash: ActorServer) { | 51 | protected constructor (hash: ActorServer) { |
45 | this.id = hash.id | 52 | this.id = hash.id |
46 | this.url = hash.url | 53 | this.url = hash.url |
@@ -53,10 +60,7 @@ export abstract class Actor implements ActorServer { | |||
53 | if (hash.updatedAt) this.updatedAt = new Date(hash.updatedAt.toString()) | 60 | if (hash.updatedAt) this.updatedAt = new Date(hash.updatedAt.toString()) |
54 | 61 | ||
55 | this.avatar = hash.avatar | 62 | this.avatar = hash.avatar |
56 | 63 | this.isLocal = Actor.IS_LOCAL(this.host) | |
57 | const absoluteAPIUrl = getAbsoluteAPIUrl() | ||
58 | const thisHost = new URL(absoluteAPIUrl).host | ||
59 | this.isLocal = this.host.trim() === thisHost | ||
60 | 64 | ||
61 | this.updateComputedAttributes() | 65 | this.updateComputedAttributes() |
62 | } | 66 | } |