From 6c374b51537126a2cba29f3eaf74faf1fc64ba96 Mon Sep 17 00:00:00 2001 From: multiple creatures Date: Mon, 6 May 2019 20:51:20 -0500 Subject: Drop OStatus support. Fix some of the Rspec tests. --- app/serializers/activitypub/activity_serializer.rb | 5 ----- app/serializers/activitypub/delete_serializer.rb | 8 +------- app/serializers/activitypub/note_serializer.rb | 15 +-------------- app/serializers/webfinger_serializer.rb | 3 --- 4 files changed, 2 insertions(+), 29 deletions(-) (limited to 'app/serializers') diff --git a/app/serializers/activitypub/activity_serializer.rb b/app/serializers/activitypub/activity_serializer.rb index c06d5c87c..21386ab8a 100644 --- a/app/serializers/activitypub/activity_serializer.rb +++ b/app/serializers/activitypub/activity_serializer.rb @@ -5,7 +5,6 @@ class ActivityPub::ActivitySerializer < ActivityPub::Serializer has_one :proper, key: :object, serializer: ActivityPub::NoteSerializer, if: :serialize_object? attribute :proper_uri, key: :object, unless: :serialize_object? - attribute :atom_uri, if: :announce? def id ActivityPub::TagManager.instance.activity_uri_for(object) @@ -35,10 +34,6 @@ class ActivityPub::ActivitySerializer < ActivityPub::Serializer ActivityPub::TagManager.instance.uri_for(object.proper) end - def atom_uri - OStatus::TagManager.instance.uri_for(object) - end - def announce? object.reblog? end diff --git a/app/serializers/activitypub/delete_serializer.rb b/app/serializers/activitypub/delete_serializer.rb index a7d5bd469..c8f918c92 100644 --- a/app/serializers/activitypub/delete_serializer.rb +++ b/app/serializers/activitypub/delete_serializer.rb @@ -2,9 +2,7 @@ class ActivityPub::DeleteSerializer < ActivityPub::Serializer class TombstoneSerializer < ActivityPub::Serializer - context_extensions :atom_uri - - attributes :id, :type, :atom_uri + attributes :id, :type def id ActivityPub::TagManager.instance.uri_for(object) @@ -13,10 +11,6 @@ class ActivityPub::DeleteSerializer < ActivityPub::Serializer def type 'Tombstone' end - - def atom_uri - OStatus::TagManager.instance.uri_for(object) - end end attributes :id, :type, :actor, :to diff --git a/app/serializers/activitypub/note_serializer.rb b/app/serializers/activitypub/note_serializer.rb index d05c9c4f8..da99b9606 100644 --- a/app/serializers/activitypub/note_serializer.rb +++ b/app/serializers/activitypub/note_serializer.rb @@ -1,13 +1,12 @@ # frozen_string_literal: true class ActivityPub::NoteSerializer < ActivityPub::Serializer - context_extensions :atom_uri, :conversation, :sensitive, + context_extensions :conversation, :sensitive, :hashtag, :emoji, :focal_point, :blurhash attributes :id, :type, :summary, :in_reply_to, :published, :url, :attributed_to, :to, :cc, :sensitive, - :atom_uri, :in_reply_to_atom_uri, :conversation, :source attribute :content @@ -102,18 +101,6 @@ class ActivityPub::NoteSerializer < ActivityPub::Serializer object.active_mentions.to_a.sort_by(&:id) + object.tags.reject { |t| t.local || t.private } + object.emojis end - def atom_uri - return unless object.local? - - OStatus::TagManager.instance.uri_for(object) - end - - def in_reply_to_atom_uri - return unless object.reply? && !object.thread.nil? - - OStatus::TagManager.instance.uri_for(object.thread) - end - def conversation return if object.conversation.nil? diff --git a/app/serializers/webfinger_serializer.rb b/app/serializers/webfinger_serializer.rb index 8c0b07702..882fcf948 100644 --- a/app/serializers/webfinger_serializer.rb +++ b/app/serializers/webfinger_serializer.rb @@ -16,11 +16,8 @@ class WebfingerSerializer < ActiveModel::Serializer def links [ { rel: 'http://webfinger.net/rel/profile-page', type: 'text/html', href: short_account_url(object) }, - { rel: 'http://schemas.google.com/g/2010#updates-from', type: 'application/atom+xml', href: account_url(object, format: 'atom') }, { rel: 'self', type: 'application/activity+json', href: account_url(object) }, - { rel: 'salmon', href: api_salmon_url(object.id) }, { rel: 'magic-public-key', href: "data:application/magic-public-key,#{object.magic_key}" }, - { rel: 'http://ostatus.org/schema/1.0/subscribe', template: "#{authorize_interaction_url}?uri={uri}" }, ] end end -- cgit