1
0
Fork 0
mirror of https://github.com/mastodon/mastodon.git synced 2024-08-20 21:08:15 -07:00

Rename generate_uri_for to generate_activity_uri, remove unused arg

This commit is contained in:
Matt Jankowski 2024-05-22 10:49:40 -04:00
parent d8c9755445
commit 74a6d62d85
5 changed files with 6 additions and 6 deletions

View file

@ -58,7 +58,7 @@ class ActivityPub::TagManager
account_url(username: username)
end
def generate_uri_for(_target)
def generate_activity_uri
URI.join(root_url, 'payloads', SecureRandom.uuid)
end

View file

@ -14,6 +14,6 @@ module ActivityPubPayloadGeneration
def generate_payload_uri
self.uri = ActivityPub::TagManager
.instance
.generate_uri_for(self)
.generate_activity_uri
end
end

View file

@ -26,7 +26,7 @@ class Relay < ApplicationRecord
alias enabled? accepted?
def enable!
activity_id = ActivityPub::TagManager.instance.generate_uri_for(nil)
activity_id = ActivityPub::TagManager.instance.generate_activity_uri
payload = Oj.dump(follow_activity(activity_id))
update!(state: :pending, follow_activity_id: activity_id)
@ -35,7 +35,7 @@ class Relay < ApplicationRecord
end
def disable!
activity_id = ActivityPub::TagManager.instance.generate_uri_for(nil)
activity_id = ActivityPub::TagManager.instance.generate_activity_uri
payload = Oj.dump(unfollow_activity(activity_id))
update!(state: :idle, follow_activity_id: nil)

View file

@ -162,7 +162,7 @@ class Report < ApplicationRecord
private
def set_uri
self.uri = ActivityPub::TagManager.instance.generate_uri_for(self) if uri.nil? && account.local?
self.uri = ActivityPub::TagManager.instance.generate_activity_uri if uri.nil? && account.local?
end
def validate_rule_ids

View file

@ -29,7 +29,7 @@ class ActivityPub::ActivityPresenter < ActiveModelSerializers::Model
def from_encrypted_message(encrypted_message)
new.tap do |presenter|
presenter.id = ActivityPub::TagManager.instance.generate_uri_for(nil)
presenter.id = ActivityPub::TagManager.instance.generate_activity_uri
presenter.type = 'Create'
presenter.actor = ActivityPub::TagManager.instance.uri_for(encrypted_message.source_account)
presenter.published = Time.now.utc