Skip to content

Commit

Permalink
Fix 14666
Browse files Browse the repository at this point in the history
  • Loading branch information
noellabo committed Sep 5, 2020
1 parent b3addd8 commit 679aa8a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/lib/activitypub/activity/create.rb
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ def conversation_from_context
uri = value_or_id(@object['context'])
conversation ||= ActivityPub::TagManager.instance.uri_to_resource(uri, Conversation)

return conversation if (conversation.present? && conversation.uri == uri) || !uri.start_with?('https://')
return conversation if (conversation.present? && (conversation.local? || conversation.uri == uri)) || !uri.start_with?('https://')

conversation_json = begin
if @object['context'].is_a?(Hash) && !invalid_origin?(uri)
Expand Down
2 changes: 1 addition & 1 deletion app/services/concerns/payloadable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def serialize_payload(record, serializer, options = {})
payload = ActiveModelSerializers::SerializableResource.new(record, options.merge(serializer: serializer, adapter: ActivityPub::Adapter)).as_json
object = record.respond_to?(:virtual_object) ? record.virtual_object : record

if (object.respond_to?(:sign?) && object.sign?) && signer && signing_enabled?
if (object.respond_to?(:sign?) && object.sign?) && signer && signing_enabled? || object.is_a?(String)
ActivityPub::LinkedDataSignature.new(payload).sign!(signer, sign_with: sign_with)
else
payload
Expand Down
4 changes: 3 additions & 1 deletion app/services/process_mentions_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,10 @@ def call(status, circle = nil)
# need to send our reply to the remote author's inbox for distribution

status.thread.mentions.includes(:account).find_each do |mention|
status.mentions.create(silent: true, account: mention.account)
status.mentions.create(silent: true, account: mention.account) unless status.account_id == mention.account_id
end

status.mentions.create(silent: true, account: status.thread.account) unless status.account_id == status.thread.account_id
end

status.save!
Expand Down

0 comments on commit 679aa8a

Please sign in to comment.