<div class="actor-info">
<div class="actor-names">
<div class="actor-display-name">{{ account.displayName }}</div>
- <div class="actor-name">{{ account.nameWithHost }}</div>
-
+ <div class="actor-name">{{ account.nameWithHost }}
+ <button ngxClipboard [cbContent]="account.nameWithHostForced" type="button" class="btn btn-outline-secondary btn-sm">
+ <span class="glyphicon glyphicon-copy"></span>
+ </button>
+ </div>
<span *ngIf="user?.blocked" [ngbTooltip]="user.blockedReason" class="badge badge-danger" i18n>Banned</span>
<span *ngIf="account.mutedByUser" class="badge badge-danger" i18n>Muted</span>
<span *ngIf="account.mutedServerByUser" class="badge badge-danger" i18n>Muted by your instance</span>
displayName: string
description: string
nameWithHost: string
+ nameWithHostForced: string
mutedByUser: boolean
mutedByInstance: boolean
mutedServerByUser: boolean
this.description = hash.description
this.userId = hash.userId
this.nameWithHost = Actor.CREATE_BY_STRING(this.name, this.host)
+ this.nameWithHostForced = Actor.CREATE_BY_STRING(this.name, this.host, true)
this.mutedByUser = false
this.mutedByInstance = false
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
}