Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 21 additions & 21 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
GEM
remote: https://rubygems.org/
specs:
activesupport (8.0.2)
activesupport (8.0.3)
base64
benchmark (>= 0.3)
bigdecimal
Expand All @@ -17,45 +17,45 @@ GEM
ast (2.4.3)
base64 (0.3.0)
benchmark (0.4.1)
bigdecimal (3.2.2)
bigdecimal (3.3.0)
concurrent-ruby (1.3.5)
connection_pool (2.5.3)
connection_pool (2.5.4)
drb (2.2.3)
i18n (1.14.7)
concurrent-ruby (~> 1.0)
json (2.12.2)
json (2.15.1)
language_server-protocol (3.17.0.5)
lint_roller (1.1.0)
logger (1.7.0)
minitest (5.25.5)
minitest (5.26.0)
parallel (1.27.0)
parser (3.3.8.0)
parser (3.3.9.0)
ast (~> 2.4.1)
racc
prettier_print (1.2.1)
prism (1.4.0)
prism (1.5.1)
racc (1.8.1)
rack (3.1.16)
rack (3.2.2)
rainbow (3.1.1)
regexp_parser (2.10.0)
rubocop (1.76.0)
regexp_parser (2.11.3)
rubocop (1.81.1)
json (~> 2.3)
language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.1.0)
parallel (~> 1.10)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 2.9.3, < 3.0)
rubocop-ast (>= 1.45.0, < 2.0)
rubocop-ast (>= 1.47.1, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 4.0)
rubocop-ast (1.45.0)
rubocop-ast (1.47.1)
parser (>= 3.3.7.2)
prism (~> 1.4)
rubocop-capybara (2.22.1)
lint_roller (~> 1.1)
rubocop (~> 1.72, >= 1.72.1)
rubocop-discourse (3.12.1)
rubocop-discourse (3.13.3)
activesupport (>= 6.1)
lint_roller (>= 1.1.0)
rubocop (>= 1.73.2)
Expand All @@ -67,13 +67,13 @@ GEM
rubocop-factory_bot (2.27.1)
lint_roller (~> 1.1)
rubocop (~> 1.72, >= 1.72.1)
rubocop-rails (2.32.0)
rubocop-rails (2.33.4)
activesupport (>= 4.2.0)
lint_roller (~> 1.1)
rack (>= 1.1)
rubocop (>= 1.75.0, < 2.0)
rubocop-ast (>= 1.44.0, < 2.0)
rubocop-rspec (3.6.0)
rubocop-rspec (3.7.0)
lint_roller (~> 1.1)
rubocop (~> 1.72, >= 1.72.1)
rubocop-rspec_rails (2.31.0)
Expand All @@ -82,14 +82,14 @@ GEM
rubocop-rspec (~> 3.5)
ruby-progressbar (1.13.0)
securerandom (0.4.1)
syntax_tree (6.2.0)
syntax_tree (6.3.0)
prettier_print (>= 1.2.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (3.1.4)
unicode-emoji (~> 4.0, >= 4.0.4)
unicode-emoji (4.0.4)
uri (1.0.3)
unicode-display_width (3.2.0)
unicode-emoji (~> 4.1)
unicode-emoji (4.1.0)
uri (1.0.4)

PLATFORMS
ruby
Expand All @@ -99,4 +99,4 @@ DEPENDENCIES
syntax_tree

BUNDLED WITH
2.6.9
2.7.2
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def update_or_create
DiscourseActivityPub::DetailedActorSerializer.new(actor, root: false).as_json,
)
else
render json: failed_json.merge(errors: handler.errors.map(&:message)), status: 400
render json: failed_json.merge(errors: handler.errors.map(&:message)), status: :bad_request
end
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class DiscourseActivityPub::AP::InboxesController < DiscourseActivityPub::AP::Ac

def create
process_json
head 202
head :accepted
end

protected
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class DiscourseActivityPub::AP::SharedInboxesController < DiscourseActivityPub::

def create
process_json
head 202
head :accepted
end

protected
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/discourse_activity_pub/actor_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def find_by_user
if actor
render json: actor.ap.json
else
render json: failed_json, status: 404
render json: failed_json, status: :not_found
end
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def destroy
if authorization && authorization.destroy!
render json: success_json
else
render json: failed_json, status: 422
render json: failed_json, status: :unprocessable_content
end
end

Expand Down
8 changes: 4 additions & 4 deletions app/controllers/discourse_activity_pub/post_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def deliver
if @post.activity_pub_deliver!
render json: success_json
else
render json: failed_json, status: 422
render json: failed_json, status: :unprocessable_content
end
end

Expand All @@ -36,7 +36,7 @@ def publish
if @post.activity_pub_publish!
render json: success_json
else
render json: failed_json, status: 422
render json: failed_json, status: :unprocessable_content
end
end

Expand All @@ -49,7 +49,7 @@ def schedule
if @post.activity_pub_schedule!
render json: success_json
else
render json: failed_json, status: 422
render json: failed_json, status: :unprocessable_content
end
end

Expand All @@ -61,7 +61,7 @@ def unschedule
if @post.activity_pub_unschedule!
render json: success_json
else
render json: failed_json, status: 422
render json: failed_json, status: :unprocessable_content
end
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class WebfingerController < ApplicationController

def index
# TODO: is this Cache Control correct for webfinger?
expires_in 1.minutes
expires_in 1.minute
render json: serialized_resource, content_type: Webfinger::CONTENT_TYPE
end

Expand Down
9 changes: 4 additions & 5 deletions app/models/discourse_activity_pub/post.rb
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,10 @@ def activity_pub_perform_activity?
def activity_pub_content
return nil unless activity_pub_enabled

if custom_fields["activity_pub_content"].present?
custom_fields["activity_pub_content"]
else
DiscourseActivityPub::ContentParser.get_content(self)
end
(
custom_fields["activity_pub_content"].presence ||
DiscourseActivityPub::ContentParser.get_content(self)
)
end

def activity_pub_published_at
Expand Down
4 changes: 2 additions & 2 deletions app/models/discourse_activity_pub_activity.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def to
result << DiscourseActivityPub::JsonLd.public_collection_id if public?
result << audience if audience

result.present? ? result : nil
(result.presence)
end

def cc
Expand All @@ -80,7 +80,7 @@ def cc
result << reply_to_audience if reply_to_audience && to != reply_to_audience
end

result.present? ? result : nil
(result.presence)
end

def announce!(actor_id)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import Component from "@glimmer/component";
import { tracked } from "@glimmer/tracking";
import { action } from "@ember/object";
import { htmlSafe } from "@ember/template";
import DButton from "discourse/components/d-button";
import DModal from "discourse/components/d-modal";
import formatDate from "discourse/helpers/format-date";
import htmlSafe from "discourse/helpers/html-safe";
import discourseLater from "discourse/lib/later";
import { clipboardCopy } from "discourse/lib/utilities";
import { i18n } from "discourse-i18n";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import ActivityPubPostActions from "../activity-pub-post-actions";
import ActivityPubPostInfo from "../activity-pub-post-info";

export default class ActivityPubPostModal extends Component {
@service modal;
@service currentUser;

get post() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import ActivityPubTopicActions from "../activity-pub-topic-actions";
import ActivityPubTopicInfo from "../activity-pub-topic-info";

export default class ActivityPubTopicModal extends Component {
@service modal;
@service currentUser;

get topic() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { service } from "@ember/service";

export default class ActivityPubActor extends Controller {
@service composer;
@service site;
@service currentUser;
// eslint-disable-next-line discourse/no-unused-services
@service site; // used in the template

@action
createTopic() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ import ActivityPubActor from "../../../models/activity-pub-actor";
export default class AdminPluginsActivityPubActorShow extends Controller {
@service dialog;
@service router;
@service site;
// eslint-disable-next-line discourse/no-unused-services
@service site; // used in the template
// eslint-disable-next-line discourse/no-unused-services
@service siteSettings; // used in the template

@tracked categoryId = null;
@tracked tags = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import ActivityPubLog from "../../../models/activity-pub-log";

export default class AdminPluginsActivityPubLog extends Controller {
@service modal;
@service router;

@tracked order = "";
@tracked asc = null;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Service, { service } from "@ember/service";
import Service from "@ember/service";
import { TrackedMap } from "@ember-compat/tracked-built-ins";
import { bind } from "discourse/lib/decorators";

Expand All @@ -13,8 +13,6 @@ const trackedAttributes = [
];

export default class ActivityPubTopicTrackingState extends Service {
@service appEvents;

attributes = new TrackedMap();
statuses = new TrackedMap();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def up
clients_by_domain =
DiscourseActivityPubClient
.where(auth_type: DiscourseActivityPubClient.auth_types[:mastodon])
.each_with_object({}) { |client, result| result[client.domain] = client }
.index_by { |client| client.domain }

authorizations =
DiscourseActivityPubActor
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"private": true,
"devDependencies": {
"@discourse/lint-configs": "2.25.0",
"ember-template-lint": "7.8.1",
"eslint": "9.28.0",
"prettier": "3.5.3",
"stylelint": "16.20.0"
"@discourse/lint-configs": "2.32.0",
"ember-template-lint": "7.9.1",
"eslint": "9.37.0",
"prettier": "3.6.2",
"stylelint": "16.25.0"
},
"engines": {
"node": ">= 22",
Expand Down
Loading