You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
queer.party/deploy/3.5.1_1-backport-aliases-fi...

26 lines
739 B

From 866451337e2f43e99ade9c8dfacac588ec3833ca Mon Sep 17 00:00:00 2001
From: Claire <claire.github-309c@sitedethib.com>
Date: Sat, 9 Apr 2022 18:49:33 +0200
Subject: [PATCH] Fix crash in alias settings page
---
app/models/account_alias.rb | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/app/models/account_alias.rb b/app/models/account_alias.rb
index 3d659142a055..b421c66e211d 100644
--- a/app/models/account_alias.rb
+++ b/app/models/account_alias.rb
@@ -28,6 +28,11 @@ def acct=(val)
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