+ blockAccountByUser (account: Account) {
+ this.blocklistService.blockAccountByUser(account)
+ .subscribe(
+ () => {
+ this.notificationsService.success(
+ this.i18n('Success'),
+ this.i18n('Account {{nameWithHost}} muted.', { nameWithHost: account.nameWithHost })
+ )
+
+ this.account.muted = true
+ this.userChanged.emit()
+ },
+
+ err => this.notificationsService.error(this.i18n('Error'), err.message)
+ )
+ }
+
+ unblockAccountByUser (account: Account) {
+ this.blocklistService.unblockAccountByUser(account)
+ .subscribe(
+ () => {
+ this.notificationsService.success(
+ this.i18n('Success'),
+ this.i18n('Account {{nameWithHost}} unmuted.', { nameWithHost: account.nameWithHost })
+ )
+
+ this.account.muted = false
+ this.userChanged.emit()
+ },
+
+ err => this.notificationsService.error(this.i18n('Error'), err.message)
+ )
+ }
+
+ blockServerByUser (host: string) {
+ this.blocklistService.blockServerByUser(host)
+ .subscribe(
+ () => {
+ this.notificationsService.success(
+ this.i18n('Success'),
+ this.i18n('Instance {{host}} muted.', { host })
+ )
+
+ this.account.mutedServer = true
+ this.userChanged.emit()
+ },
+
+ err => this.notificationsService.error(this.i18n('Error'), err.message)
+ )
+ }
+
+ unblockServerByUser (host: string) {
+ this.blocklistService.unblockServerByUser(host)
+ .subscribe(
+ () => {
+ this.notificationsService.success(
+ this.i18n('Success'),
+ this.i18n('Instance {{host}} unmuted.', { host })
+ )
+
+ this.account.mutedServer = false
+ this.userChanged.emit()
+ },
+
+ err => this.notificationsService.error(this.i18n('Error'), err.message)
+ )
+ }
+