revert OStatus xmlns to mastodon.social

This commit is contained in:
robcolbert 2019-07-06 21:57:50 -04:00
parent b4d3acc18a
commit 948ba449fb
6 changed files with 8 additions and 8 deletions

View File

@ -90,7 +90,7 @@ class OStatus::Activity::Creation < OStatus::Activity::Base
end end
def visibility_scope def visibility_scope
@xml.at_xpath('./gabsocial:scope', gabsocial: OStatus::TagManager::GABSCL_XMLNS)&.content&.to_sym || :public @xml.at_xpath('./gabsocial:scope', gabsocial: OStatus::TagManager::MTDN_XMLNS)&.content&.to_sym || :public
end end
def published def published

View File

@ -345,7 +345,7 @@ class OStatus::AtomSerializer
parent['xmlns:poco'] = OStatus::TagManager::POCO_XMLNS parent['xmlns:poco'] = OStatus::TagManager::POCO_XMLNS
parent['xmlns:media'] = OStatus::TagManager::MEDIA_XMLNS parent['xmlns:media'] = OStatus::TagManager::MEDIA_XMLNS
parent['xmlns:ostatus'] = OStatus::TagManager::OS_XMLNS parent['xmlns:ostatus'] = OStatus::TagManager::OS_XMLNS
parent['xmlns:gabsocial'] = OStatus::TagManager::GABSCL_XMLNS parent['xmlns:gabsocial'] = OStatus::TagManager::MTDN_XMLNS
end end
def serialize_status_attributes(entry, status) def serialize_status_attributes(entry, status)

View File

@ -15,8 +15,8 @@ class OStatus::TagManager
authorize: 'http://activitystrea.ms/schema/1.0/authorize', authorize: 'http://activitystrea.ms/schema/1.0/authorize',
reject: 'http://activitystrea.ms/schema/1.0/reject', reject: 'http://activitystrea.ms/schema/1.0/reject',
unfollow: 'http://ostatus.org/schema/1.0/unfollow', unfollow: 'http://ostatus.org/schema/1.0/unfollow',
block: 'http://gab.com/schema/1.0/block', block: 'http://mastodon.social/schema/1.0/block',
unblock: 'http://gab.com/schema/1.0/unblock', unblock: 'http://mastodon.social/schema/1.0/unblock',
}.freeze }.freeze
TYPES = { TYPES = {
@ -39,7 +39,7 @@ class OStatus::TagManager
POCO_XMLNS = 'http://portablecontacts.net/spec/1.0' POCO_XMLNS = 'http://portablecontacts.net/spec/1.0'
DFRN_XMLNS = 'http://purl.org/macgirvin/dfrn/1.0' DFRN_XMLNS = 'http://purl.org/macgirvin/dfrn/1.0'
OS_XMLNS = 'http://ostatus.org/schema/1.0' OS_XMLNS = 'http://ostatus.org/schema/1.0'
GABSCL_XMLNS = 'http://gab.com/schema/1.0' MTDN_XMLNS = 'http://mastodon.social/schema/1.0'
def unique_tag(date, id, type) def unique_tag(date, id, type)
"tag:#{Rails.configuration.x.local_domain},#{date.strftime('%Y-%m-%d')}:objectId=#{id}:objectType=#{type}" "tag:#{Rails.configuration.x.local_domain},#{date.strftime('%Y-%m-%d')}:objectId=#{id}:objectType=#{type}"

View File

@ -30,7 +30,7 @@ class RemoteProfile
end end
def scope def scope
@scope ||= author.at_xpath('./gabsocial:scope', gabsocial: OStatus::TagManager::GABSCL_XMLNS)&.content @scope ||= author.at_xpath('./gabsocial:scope', gabsocial: OStatus::TagManager::MTDN_XMLNS)&.content
end end
def avatar def avatar

View File

@ -50,7 +50,7 @@ RSpec.describe OStatus::AtomSerializer do
expect(element['xmlns:poco']).to eq OStatus::TagManager::POCO_XMLNS expect(element['xmlns:poco']).to eq OStatus::TagManager::POCO_XMLNS
expect(element['xmlns:media']).to eq OStatus::TagManager::MEDIA_XMLNS expect(element['xmlns:media']).to eq OStatus::TagManager::MEDIA_XMLNS
expect(element['xmlns:ostatus']).to eq OStatus::TagManager::OS_XMLNS expect(element['xmlns:ostatus']).to eq OStatus::TagManager::OS_XMLNS
expect(element['xmlns:gabsocial']).to eq OStatus::TagManager::GABSCL_XMLNS expect(element['xmlns:gabsocial']).to eq OStatus::TagManager::MTDN_XMLNS
end end
end end

View File

@ -92,7 +92,7 @@ RSpec.describe RemoteProfile do
it 'calls author.at_xpath.content' do it 'calls author.at_xpath.content' do
expect(author).to receive_message_chain(:at_xpath, :content).with( expect(author).to receive_message_chain(:at_xpath, :content).with(
'./gabsocial:scope', './gabsocial:scope',
gabsocial: OStatus::TagManager::GABSCL_XMLNS gabsocial: OStatus::TagManager::MTDN_XMLNS
).with(no_args) ).with(no_args)
remote_profile.scope remote_profile.scope