+ blockAccountByUser (account: Account) {
+ this.blocklistService.blockAccountByUser(account)
+ .subscribe(
+ () => {
+ this.notifier.success(this.i18n('Account {{nameWithHost}} muted.', { nameWithHost: account.nameWithHost }))
+
+ this.account.mutedByUser = true
+ this.userChanged.emit()
+ },
+
+ err => this.notifier.error(err.message)
+ )
+ }
+
+ unblockAccountByUser (account: Account) {
+ this.blocklistService.unblockAccountByUser(account)
+ .subscribe(
+ () => {
+ this.notifier.success(this.i18n('Account {{nameWithHost}} unmuted.', { nameWithHost: account.nameWithHost }))
+
+ this.account.mutedByUser = false
+ this.userChanged.emit()
+ },
+
+ err => this.notifier.error(err.message)
+ )
+ }
+
+ blockServerByUser (host: string) {
+ this.blocklistService.blockServerByUser(host)
+ .subscribe(
+ () => {
+ this.notifier.success(this.i18n('Instance {{host}} muted.', { host }))
+
+ this.account.mutedServerByUser = true
+ this.userChanged.emit()
+ },
+
+ err => this.notifier.error(err.message)
+ )
+ }
+
+ unblockServerByUser (host: string) {
+ this.blocklistService.unblockServerByUser(host)
+ .subscribe(
+ () => {
+ this.notifier.success(this.i18n('Instance {{host}} unmuted.', { host }))
+
+ this.account.mutedServerByUser = false
+ this.userChanged.emit()
+ },
+
+ err => this.notifier.error(err.message)
+ )
+ }
+
+ blockAccountByInstance (account: Account) {
+ this.blocklistService.blockAccountByInstance(account)
+ .subscribe(
+ () => {
+ this.notifier.success(this.i18n('Account {{nameWithHost}} muted by the instance.', { nameWithHost: account.nameWithHost }))
+
+ this.account.mutedByInstance = true
+ this.userChanged.emit()
+ },
+
+ err => this.notifier.error(err.message)
+ )
+ }
+
+ unblockAccountByInstance (account: Account) {
+ this.blocklistService.unblockAccountByInstance(account)
+ .subscribe(
+ () => {
+ this.notifier.success(this.i18n('Account {{nameWithHost}} unmuted by the instance.', { nameWithHost: account.nameWithHost }))
+
+ this.account.mutedByInstance = false
+ this.userChanged.emit()
+ },
+
+ err => this.notifier.error(err.message)
+ )
+ }
+
+ blockServerByInstance (host: string) {
+ this.blocklistService.blockServerByInstance(host)
+ .subscribe(
+ () => {
+ this.notifier.success(this.i18n('Instance {{host}} muted by the instance.', { host }))
+
+ this.account.mutedServerByInstance = true
+ this.userChanged.emit()
+ },
+
+ err => this.notifier.error(err.message)
+ )
+ }
+
+ unblockServerByInstance (host: string) {
+ this.blocklistService.unblockServerByInstance(host)
+ .subscribe(
+ () => {
+ this.notifier.success(this.i18n('Instance {{host}} unmuted by the instance.', { host }))
+
+ this.account.mutedServerByInstance = false
+ this.userChanged.emit()
+ },
+
+ err => this.notifier.error(err.message)
+ )
+ }
+