diff options
author | Claire <claire.github-309c@sitedethib.com> | 2022-10-28 11:36:25 +0200 |
---|---|---|
committer | Claire <claire.github-309c@sitedethib.com> | 2022-10-28 19:23:58 +0200 |
commit | cb19be67d1b47dd04cb5bb88e09f0101a614bd1c (patch) | |
tree | 6c85ccc6ac0279ae7b1ed4dff56c8e83f71a0c95 /app/presenters | |
parent | 371563b0e249b6369e04709fb974a8e57413529f (diff) | |
parent | 8dfe5179ee7186e549dbe1186a151ffa848fe8ab (diff) |
Merge branch 'main' into glitch-soc/merge-upstream
Diffstat (limited to 'app/presenters')
-rw-r--r-- | app/presenters/initial_state_presenter.rb | 2 | ||||
-rw-r--r-- | app/presenters/instance_presenter.rb | 8 |
2 files changed, 4 insertions, 6 deletions
diff --git a/app/presenters/initial_state_presenter.rb b/app/presenters/initial_state_presenter.rb index 129ea2a46..ed0479211 100644 --- a/app/presenters/initial_state_presenter.rb +++ b/app/presenters/initial_state_presenter.rb @@ -2,7 +2,7 @@ class InitialStatePresenter < ActiveModelSerializers::Model attributes :settings, :push_subscription, :token, - :current_account, :admin, :text, :visibility + :current_account, :admin, :owner, :text, :visibility def role current_account&.user_role diff --git a/app/presenters/instance_presenter.rb b/app/presenters/instance_presenter.rb index c461ac55f..fba3cc734 100644 --- a/app/presenters/instance_presenter.rb +++ b/app/presenters/instance_presenter.rb @@ -12,7 +12,9 @@ class InstancePresenter < ActiveModelSerializers::Model end def account - Account.find_local(Setting.site_contact_username.strip.gsub(/\A@/, '')) + username, domain = Setting.site_contact_username.strip.gsub(/\A@/, '').split('@', 2) + domain = nil if TagManager.instance.local_domain?(domain) + Account.find_remote(username, domain) if username.present? end end @@ -84,10 +86,6 @@ class InstancePresenter < ActiveModelSerializers::Model @thumbnail ||= Rails.cache.fetch('site_uploads/thumbnail') { SiteUpload.find_by(var: 'thumbnail') } end - def hero - @hero ||= Rails.cache.fetch('site_uploads/hero') { SiteUpload.find_by(var: 'hero') } - end - def mascot @mascot ||= Rails.cache.fetch('site_uploads/mascot') { SiteUpload.find_by(var: 'mascot') } end |