Replace hyphen with underscore in Mastodon address
Unfortunately, Mastodon only allows underscores for usernames, and reversely, akkounts only allows hyphens and no underscores.
This commit is contained in:
@@ -131,7 +131,7 @@ class User < ApplicationRecord
|
||||
|
||||
def mastodon_address
|
||||
return nil unless Setting.mastodon_enabled?
|
||||
"#{self.cn}@#{Setting.mastodon_address_domain}"
|
||||
"#{self.cn.gsub("-", "_")}@#{Setting.mastodon_address_domain}"
|
||||
end
|
||||
|
||||
def valid_attribute?(attribute_name)
|
||||
|
||||
Reference in New Issue
Block a user