mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-12-13 15:58:50 +00:00
Merge commit '22e2e7f02b2f25f30abd6a616bc3b0b543b30279' into glitch-soc/merge-upstream
This commit is contained in:
@@ -105,7 +105,7 @@ class ReportReasonSelector extends PureComponent {
|
||||
};
|
||||
|
||||
componentDidMount() {
|
||||
api(false).get('/api/v1/instance').then(res => {
|
||||
api(false).get('/api/v2/instance').then(res => {
|
||||
this.setState({
|
||||
rules: res.data.rules,
|
||||
});
|
||||
|
||||
@@ -97,11 +97,11 @@ class ActivityPub::Parser::StatusParser
|
||||
end
|
||||
|
||||
def favourites_count
|
||||
@object.dig('likes', 'totalItems')
|
||||
@object['likes']['totalItems'] if @object.is_a?(Hash) && @object['likes'].is_a?(Hash)
|
||||
end
|
||||
|
||||
def reblogs_count
|
||||
@object.dig('shares', 'totalItems')
|
||||
@object['shares']['totalItems'] if @object.is_a?(Hash) && @object['shares'].is_a?(Hash)
|
||||
end
|
||||
|
||||
def quote_policy
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'vips'
|
||||
|
||||
def gen_border(codepoint, color)
|
||||
input = Rails.public_path.join('emoji', "#{codepoint}.svg")
|
||||
dest = Rails.public_path.join('emoji', "#{codepoint}_border.svg")
|
||||
@@ -191,6 +189,8 @@ namespace :emojis do
|
||||
|
||||
desc 'Generate a spritesheet of emojis'
|
||||
task :generate_emoji_sheet do
|
||||
require 'vips'
|
||||
|
||||
src = Rails.root.join('app', 'javascript', 'mastodon', 'features', 'emoji', 'emoji_data.json')
|
||||
sheet = Oj.load(File.read(src))
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ RSpec.describe ActivityPub::Activity::Create do
|
||||
type: 'Create',
|
||||
actor: ActivityPub::TagManager.instance.uri_for(sender),
|
||||
object: object_json,
|
||||
}.with_indifferent_access
|
||||
}.deep_stringify_keys
|
||||
end
|
||||
|
||||
before do
|
||||
@@ -102,7 +102,7 @@ RSpec.describe ActivityPub::Activity::Create do
|
||||
type: 'Create',
|
||||
actor: ActivityPub::TagManager.instance.uri_for(sender),
|
||||
object: json,
|
||||
}.with_indifferent_access
|
||||
}.deep_stringify_keys
|
||||
end
|
||||
|
||||
before do
|
||||
@@ -1126,7 +1126,7 @@ RSpec.describe ActivityPub::Activity::Create do
|
||||
type: 'Create',
|
||||
actor: ActivityPub::TagManager.instance.uri_for(sender),
|
||||
object: Addressable::URI.new(scheme: 'bear', query_values: { t: token, u: object_json[:id] }).to_s,
|
||||
}.with_indifferent_access
|
||||
}.deep_stringify_keys
|
||||
end
|
||||
|
||||
let(:object_json) do
|
||||
|
||||
@@ -16,7 +16,7 @@ RSpec.describe ActivityPub::Parser::StatusParser do
|
||||
type: 'Create',
|
||||
actor: ActivityPub::TagManager.instance.uri_for(sender),
|
||||
object: object_json,
|
||||
}.with_indifferent_access
|
||||
}.deep_stringify_keys
|
||||
end
|
||||
|
||||
let(:object_json) do
|
||||
@@ -49,6 +49,24 @@ RSpec.describe ActivityPub::Parser::StatusParser do
|
||||
)
|
||||
end
|
||||
|
||||
context 'when the likes collection is not inlined' do
|
||||
let(:object_json) do
|
||||
{
|
||||
id: [ActivityPub::TagManager.instance.uri_for(sender), 'post1'].join('/'),
|
||||
type: 'Note',
|
||||
to: 'https://www.w3.org/ns/activitystreams#Public',
|
||||
content: 'bleh',
|
||||
published: 1.hour.ago.utc.iso8601,
|
||||
updated: 1.hour.ago.utc.iso8601,
|
||||
likes: 'https://example.com/collections/likes',
|
||||
}
|
||||
end
|
||||
|
||||
it 'does not raise an error' do
|
||||
expect { subject.favourites_count }.to_not raise_error
|
||||
end
|
||||
end
|
||||
|
||||
describe '#quote_policy' do
|
||||
subject do
|
||||
described_class
|
||||
|
||||
Reference in New Issue
Block a user