From 7944ed6fe51d00e49a044e04e624e72ff7be3bce Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Mon, 21 Nov 2016 22:04:10 +0100 Subject: [PATCH 1/3] Adding option to specify asset server, filter followers query by local accounts during Fan Out On Write to load less stuff into memory --- app/services/fan_out_on_write_service.rb | 4 ++-- config/environments/production.rb | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/services/fan_out_on_write_service.rb b/app/services/fan_out_on_write_service.rb index 70cf06e0..78cb0b13 100644 --- a/app/services/fan_out_on_write_service.rb +++ b/app/services/fan_out_on_write_service.rb @@ -24,8 +24,8 @@ class FanOutOnWriteService < BaseService def deliver_to_followers(status) Rails.logger.debug "Delivering status #{status.id} to followers" - status.account.followers.find_each do |follower| - next if !follower.local? || FeedManager.instance.filter?(:home, status, follower) + status.account.followers.where(domain: nil).find_each do |follower| + next if FeedManager.instance.filter?(:home, status, follower) FeedManager.instance.push(:home, follower, status) end end diff --git a/config/environments/production.rb b/config/environments/production.rb index 27238e3d..7f13fcf6 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -13,6 +13,7 @@ Rails.application.configure do # Full error reports are disabled and caching is turned on. config.consider_all_requests_local = false config.action_controller.perform_caching = true + config.action_controller.asset_host = ENV['CDN_HOST'] # Disable serving static files from the `/public` folder by default since # Apache or NGINX already handles this. From 7abbb02824faff2c889197df0e45c11bd9aeca07 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Mon, 21 Nov 2016 22:33:44 +0100 Subject: [PATCH 2/3] Fix #163 - No need for Safari chrome on iOS --- app/views/layouts/application.html.haml | 1 + 1 file changed, 1 insertion(+) diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 7e28d27e..87f98198 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -9,6 +9,7 @@ %link{:rel => "manifest", :href => "/manifest.json"}/ %meta{:name => "msapplication-config", :content => "/browserconfig.xml"}/ %meta{:name => "theme-color", :content => "#2b90d9"}/ + %meta{:name => "apple-mobile-web-app-capable", :content => "yes"}/ %title = "#{yield(:page_title)} - " if content_for?(:page_title) From 1788164352db23917c540e42a839908ecc4e0463 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Mon, 21 Nov 2016 23:05:11 +0100 Subject: [PATCH 3/3] Local accounts can control "silenced" attribute which removes them from public timeline --- app/controllers/settings/profiles_controller.rb | 2 +- app/views/settings/profiles/show.html.haml | 1 + config/locales/simple_form.de.yml | 1 + config/locales/simple_form.en.yml | 1 + config/locales/simple_form.es.yml | 1 + 5 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/controllers/settings/profiles_controller.rb b/app/controllers/settings/profiles_controller.rb index deff8fc7..4b2b5a13 100644 --- a/app/controllers/settings/profiles_controller.rb +++ b/app/controllers/settings/profiles_controller.rb @@ -20,7 +20,7 @@ class Settings::ProfilesController < ApplicationController private def account_params - params.require(:account).permit(:display_name, :note, :avatar, :header) + params.require(:account).permit(:display_name, :note, :avatar, :header, :silenced) end def set_account diff --git a/app/views/settings/profiles/show.html.haml b/app/views/settings/profiles/show.html.haml index c2f1adb1..e5f8a46c 100644 --- a/app/views/settings/profiles/show.html.haml +++ b/app/views/settings/profiles/show.html.haml @@ -8,6 +8,7 @@ = f.input :note, placeholder: t('simple_form.labels.defaults.note') = f.input :avatar, wrapper: :with_label = f.input :header, wrapper: :with_label + = f.input :silenced, as: :boolean, wrapper: :with_label .actions = f.button :button, t('generic.save_changes'), type: :submit diff --git a/config/locales/simple_form.de.yml b/config/locales/simple_form.de.yml index 6e6758df..65714dbd 100644 --- a/config/locales/simple_form.de.yml +++ b/config/locales/simple_form.de.yml @@ -15,6 +15,7 @@ de: note: Über mich password: Passwort username: Nutzername + silenced: Öffentliche Beiträge nicht auflisten notification_emails: favourite: E-mail senden, wenn jemand meinen Beitrag favorisiert follow: E-mail senden, wenn mir jemand folgt diff --git a/config/locales/simple_form.en.yml b/config/locales/simple_form.en.yml index b8a69a07..5b66fccd 100644 --- a/config/locales/simple_form.en.yml +++ b/config/locales/simple_form.en.yml @@ -15,6 +15,7 @@ en: note: Bio password: Password username: Username + silenced: Unlisted mode notification_emails: favourite: Send e-mail when someone favourites your status follow: Send e-mail when someone follows you diff --git a/config/locales/simple_form.es.yml b/config/locales/simple_form.es.yml index 1ac863b6..1909474a 100644 --- a/config/locales/simple_form.es.yml +++ b/config/locales/simple_form.es.yml @@ -15,6 +15,7 @@ es: note: Biografía password: Contraseña username: Nombre de usuario + silenced: No listado notification_emails: favourite: Enviar correo electrónico cuando alguien de a favorito en su publicación follow: Enviar correo electrónico cuando alguien le siga