diff options
author | Fire Demon <firedemon@creature.cafe> | 2020-11-12 17:42:53 -0600 |
---|---|---|
committer | Fire Demon <firedemon@creature.cafe> | 2020-11-14 17:39:08 -0600 |
commit | f60e0b62f4e5300645f235983e5b75bcf16b370d (patch) | |
tree | 0c437e6600b7a8bdf806d63fa76ce751bbe66d58 /app/lib | |
parent | ec3abd7c87116ad2df5b1da5701afe68a7f74844 (diff) | |
parent | 265b26489a9214a6c98a4dfa88f08ce490211ebc (diff) |
Merge remote-tracking branch 'upstream/master' into merge-glitch
Diffstat (limited to 'app/lib')
-rw-r--r-- | app/lib/activitypub/activity/create.rb | 2 | ||||
-rw-r--r-- | app/lib/activitypub/activity/move.rb | 3 | ||||
-rw-r--r-- | app/lib/activitypub/adapter.rb | 1 | ||||
-rw-r--r-- | app/lib/webfinger.rb | 4 |
4 files changed, 9 insertions, 1 deletions
diff --git a/app/lib/activitypub/activity/create.rb b/app/lib/activitypub/activity/create.rb index fd0b406b4..98bcada7a 100644 --- a/app/lib/activitypub/activity/create.rb +++ b/app/lib/activitypub/activity/create.rb @@ -134,7 +134,7 @@ class ActivityPub::Activity::Create < ActivityPub::Activity expires_at: @object['expires'], override_timestamps: @options[:override_timestamps], reply: @object['inReplyTo'].present?, - sensitive: @object['sensitive'] || false, + sensitive: @account.sensitized? || @object['sensitive'] || false, visibility: visibility_from_audience, thread: replied_to_status, conversation: conversation_from_uri(@object['conversation']), diff --git a/app/lib/activitypub/activity/move.rb b/app/lib/activitypub/activity/move.rb index 2103f503f..7e073f64d 100644 --- a/app/lib/activitypub/activity/move.rb +++ b/app/lib/activitypub/activity/move.rb @@ -20,6 +20,9 @@ class ActivityPub::Activity::Move < ActivityPub::Activity # Initiate a re-follow for each follower MoveWorker.perform_async(origin_account.id, target_account.id) + rescue + unmark_as_processing! + raise end private diff --git a/app/lib/activitypub/adapter.rb b/app/lib/activitypub/adapter.rb index 93fd2d910..bf5a49f05 100644 --- a/app/lib/activitypub/adapter.rb +++ b/app/lib/activitypub/adapter.rb @@ -36,6 +36,7 @@ class ActivityPub::Adapter < ActiveModelSerializers::Adapter::Base discoverable: { 'toot' => 'http://joinmastodon.org/ns#', 'discoverable' => 'toot:discoverable' }, voters_count: { 'toot' => 'http://joinmastodon.org/ns#', 'votersCount' => 'toot:votersCount' }, olm: { 'toot' => 'http://joinmastodon.org/ns#', 'Device' => 'toot:Device', 'Ed25519Signature' => 'toot:Ed25519Signature', 'Ed25519Key' => 'toot:Ed25519Key', 'Curve25519Key' => 'toot:Curve25519Key', 'EncryptedMessage' => 'toot:EncryptedMessage', 'publicKeyBase64' => 'toot:publicKeyBase64', 'deviceId' => 'toot:deviceId', 'claim' => { '@type' => '@id', '@id' => 'toot:claim' }, 'fingerprintKey' => { '@type' => '@id', '@id' => 'toot:fingerprintKey' }, 'identityKey' => { '@type' => '@id', '@id' => 'toot:identityKey' }, 'devices' => { '@type' => '@id', '@id' => 'toot:devices' }, 'messageFranking' => 'toot:messageFranking', 'messageType' => 'toot:messageType', 'cipherText' => 'toot:cipherText' }, + suspended: { 'toot' => 'http://joinmastodon.org/ns#', 'suspended' => 'toot:suspended' }, }.freeze def self.default_key_transform diff --git a/app/lib/webfinger.rb b/app/lib/webfinger.rb index b2374c494..c7aa43bb3 100644 --- a/app/lib/webfinger.rb +++ b/app/lib/webfinger.rb @@ -2,6 +2,8 @@ class Webfinger class Error < StandardError; end + class GoneError < Error; end + class RedirectError < StandardError; end class Response def initialize(body) @@ -47,6 +49,8 @@ class Webfinger res.body_with_limit elsif res.code == 404 && use_fallback body_from_host_meta + elsif res.code == 410 + raise Webfinger::GoneError, "#{@uri} is gone from the server" else raise Webfinger::Error, "Request for #{@uri} returned HTTP #{res.code}" end |