about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/components/locales/fi.jsx12
-rw-r--r--app/models/status.rb4
-rw-r--r--app/services/fan_out_on_write_service.rb17
-rw-r--r--app/workers/after_remote_follow_request_worker.rb2
-rw-r--r--app/workers/after_remote_follow_worker.rb2
-rw-r--r--app/workers/application_worker.rb5
-rw-r--r--app/workers/distribution_worker.rb4
7 files changed, 28 insertions, 18 deletions
diff --git a/app/assets/javascripts/components/locales/fi.jsx b/app/assets/javascripts/components/locales/fi.jsx
index 7b151d6f8..b3ae4bc56 100644
--- a/app/assets/javascripts/components/locales/fi.jsx
+++ b/app/assets/javascripts/components/locales/fi.jsx
@@ -5,9 +5,9 @@ const fi = {
   "status.mention": "Mainitse @{name}",
   "status.delete": "Poista",
   "status.reply": "Vastaa",
-  "status.reblog": "Boostaa",
+  "status.reblog": "Buustaa",
   "status.favourite": "Tykkää",
-  "status.reblogged_by": "{name} boostattu",
+  "status.reblogged_by": "{name} buustasi",
   "status.sensitive_warning": "Arkaluontoista sisältöä",
   "status.sensitive_toggle": "Klikkaa nähdäksesi",
   "video_player.toggle_sound": "Äänet päälle/pois",
@@ -28,7 +28,7 @@ const fi = {
   "getting_started.open_source_notice": "Mastodon Mastodon on avoimen lähdekoodin ohjelma. Voit avustaa tai raportoida ongelmia GitHub palvelussa {github}. {apps}.",
   "column.home": "Koti",
   "column.community": "Paikallinen aikajana",
-  "column.public": "Yhdistetty aikajana",
+  "column.public": "Yleinen aikajana",
   "column.notifications": "Ilmoitukset",
   "tabs_bar.compose": "Luo",
   "tabs_bar.home": "Koti",
@@ -41,7 +41,7 @@ const fi = {
   "compose_form.spoiler": "Piiloita teksti varoituksen taakse",
   "compose_form.private": "Merkitse yksityiseksi",
   "compose_form.privacy_disclaimer": "Sinun yksityinen status toimitetaan mainitsemallesi käyttäjille domaineissa {domains}. Luotatko {domainsCount, plural, one {tähän palvelimeen} other {näihin palvelimiin}}? Postauksen yksityisyys toimii van Mastodon palvelimilla. Jos {domains} {domainsCount, plural, one {ei ole Mastodon palvelin} other {eivät ole Mastodon palvelin}}, viestiin ei tule Yksityinen-merkintää, ja sitä voidaan boostata tai muuten tehdä näkyväksi muille vastaanottajille.",
-  "compose_form.unlisted": "Älä näytä julkisilla aikajanoilla",
+  "compose_form.unlisted": "Älä näytä yleisillä aikajanoilla",
   "navigation_bar.edit_profile": "Muokkaa profiilia",
   "navigation_bar.preferences": "Ominaisuudet",
   "navigation_bar.community_timeline": "Paikallinen aikajana",
@@ -55,14 +55,14 @@ const fi = {
   "upload_form.undo": "Peru",
   "notification.follow": "{name} seurasi sinua",
   "notification.favourite": "{name} tykkäsi statuksestasi",
-  "notification.reblog": "{name} boostasi statustasi",
+  "notification.reblog": "{name} buustasi statustasi",
   "notification.mention": "{name} mainitsi sinut",
   "notifications.column_settings.alert": "Työpöytä ilmoitukset",
   "notifications.column_settings.show": "Näytä sarakkeessa",
   "notifications.column_settings.follow": "Uusia seuraajia:",
   "notifications.column_settings.favourite": "Tykkäyksiä:",
   "notifications.column_settings.mention": "Mainintoja:",
-  "notifications.column_settings.reblog": "Boosteja:",
+  "notifications.column_settings.reblog": "Buusteja:",
 };
 
 export default fi;
diff --git a/app/models/status.rb b/app/models/status.rb
index daf128572..6948ad77c 100644
--- a/app/models/status.rb
+++ b/app/models/status.rb
@@ -161,9 +161,9 @@ class Status < ApplicationRecord
       return where.not(visibility: [:private, :direct]) if account.nil?
 
       if target_account.blocking?(account) # get rid of blocked peeps
-        where('1 = 0')
+        none
       elsif account.id == target_account.id # author can see own stuff
-        where('1 = 1')
+        all
       elsif account.following?(target_account) # followers can see followers-only stuff, but also things they are mentioned in
         joins('LEFT OUTER JOIN mentions ON statuses.id = mentions.status_id AND mentions.account_id = ' + account.id.to_s)
           .where('statuses.visibility != ? OR mentions.id IS NOT NULL', Status.visibilities[:direct])
diff --git a/app/services/fan_out_on_write_service.rb b/app/services/fan_out_on_write_service.rb
index 42222c25b..106d257ba 100644
--- a/app/services/fan_out_on_write_service.rb
+++ b/app/services/fan_out_on_write_service.rb
@@ -16,6 +16,7 @@ class FanOutOnWriteService < BaseService
 
     return if status.account.silenced? || !status.public_visibility? || status.reblog?
 
+    render_anonymous_payload(status)
     deliver_to_hashtags(status)
 
     return if status.reply? && status.in_reply_to_account_id != status.account_id
@@ -48,23 +49,23 @@ class FanOutOnWriteService < BaseService
     end
   end
 
+  def render_anonymous_payload(status)
+    @payload = FeedManager.instance.inline_render(nil, 'api/v1/statuses/show', status)
+  end
+
   def deliver_to_hashtags(status)
     Rails.logger.debug "Delivering status #{status.id} to hashtags"
 
-    payload = FeedManager.instance.inline_render(nil, 'api/v1/statuses/show', status)
-
     status.tags.pluck(:name).each do |hashtag|
-      FeedManager.instance.broadcast("hashtag:#{hashtag}", event: 'update', payload: payload)
-      FeedManager.instance.broadcast("hashtag:#{hashtag}:local", event: 'update', payload: payload) if status.account.local?
+      FeedManager.instance.broadcast("hashtag:#{hashtag}", event: 'update', payload: @payload)
+      FeedManager.instance.broadcast("hashtag:#{hashtag}:local", event: 'update', payload: @payload) if status.account.local?
     end
   end
 
   def deliver_to_public(status)
     Rails.logger.debug "Delivering status #{status.id} to public timeline"
 
-    payload = FeedManager.instance.inline_render(nil, 'api/v1/statuses/show', status)
-
-    FeedManager.instance.broadcast(:public, event: 'update', payload: payload)
-    FeedManager.instance.broadcast('public:local', event: 'update', payload: payload) if status.account.local?
+    FeedManager.instance.broadcast(:public, event: 'update', payload: @payload)
+    FeedManager.instance.broadcast('public:local', event: 'update', payload: @payload) if status.account.local?
   end
 end
diff --git a/app/workers/after_remote_follow_request_worker.rb b/app/workers/after_remote_follow_request_worker.rb
index 1f2db3061..928069211 100644
--- a/app/workers/after_remote_follow_request_worker.rb
+++ b/app/workers/after_remote_follow_request_worker.rb
@@ -13,5 +13,7 @@ class AfterRemoteFollowRequestWorker
 
     follow_request.destroy
     FollowService.new.call(follow_request.account, updated_account.acct)
+  rescue ActiveRecord::RecordNotFound
+    true
   end
 end
diff --git a/app/workers/after_remote_follow_worker.rb b/app/workers/after_remote_follow_worker.rb
index bdd2c2a91..d12fa3454 100644
--- a/app/workers/after_remote_follow_worker.rb
+++ b/app/workers/after_remote_follow_worker.rb
@@ -13,5 +13,7 @@ class AfterRemoteFollowWorker
 
     follow.destroy
     FollowService.new.call(follow.account, updated_account.acct)
+  rescue ActiveRecord::RecordNotFound
+    true
   end
 end
diff --git a/app/workers/application_worker.rb b/app/workers/application_worker.rb
new file mode 100644
index 000000000..f2d7c1062
--- /dev/null
+++ b/app/workers/application_worker.rb
@@ -0,0 +1,5 @@
+class ApplicationWorker
+  def info(message)
+    Rails.logger.info("#{self.class.name} - #{message}")
+  end
+end
diff --git a/app/workers/distribution_worker.rb b/app/workers/distribution_worker.rb
index f4e738d80..9a2867ea6 100644
--- a/app/workers/distribution_worker.rb
+++ b/app/workers/distribution_worker.rb
@@ -1,6 +1,6 @@
 # frozen_string_literal: true
 
-class DistributionWorker
+class DistributionWorker < ApplicationWorker
   include Sidekiq::Worker
 
   def perform(status_id)
@@ -9,6 +9,6 @@ class DistributionWorker
     FanOutOnWriteService.new.call(status)
     WarmCacheService.new.call(status)
   rescue ActiveRecord::RecordNotFound
-    true
+    info("Couldn't find the status")
   end
 end