summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2022-04-09 20:11:06 +0200
committerGitHub <noreply@github.com>2022-04-09 20:11:06 +0200
commitdc503472477000597f2ff1b6a5c37e8ac4dd2d8c (patch)
tree013a81d46713e155ae7aa0ed3725a41c690b3314 /app
parented5491e5de6ede501715c421ad5fa53493f61250 (diff)
Fix crash in alias settings page (#18004)
Diffstat (limited to 'app')
-rw-r--r--app/models/account_alias.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/models/account_alias.rb b/app/models/account_alias.rb
index 3d659142a05..b421c66e211 100644
--- a/app/models/account_alias.rb
+++ b/app/models/account_alias.rb
@@ -28,6 +28,11 @@ class AccountAlias < ApplicationRecord
super(val.start_with?('@') ? val[1..-1] : val)
end
+ def pretty_acct
+ username, domain = acct.split('@')
+ domain.nil? ? username : "#{username}@#{Addressable::IDNA.to_unicode(domain)}"
+ end
+
private
def set_uri