about summary refs log tree commit diff
path: root/app/lib/activitypub/activity.rb
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2019-10-27 12:14:01 +0100
committerThibaut Girka <thib@sitedethib.com>2019-10-27 12:14:01 +0100
commit41a98b654372532c389e720a0ecd08b9a9884b6d (patch)
treeaff32a956d3d12d67b94e3193cd3a8d6b8446b9b /app/lib/activitypub/activity.rb
parent18c07738a6b0fa3558863dbb1610695ab6f11b74 (diff)
parent4988ebba4e31aff5dee657836cf059b5843d9eb8 (diff)
Merge branch 'master' into glitch-soc/merge-upstream
Conflicts:
- README.md
- app/helpers/statuses_helper.rb
  Upstream moved account helpers to their own file, we had extra
  helpers there, moved too.
- app/lib/sanitize_config.rb
- app/models/user.rb
- app/serializers/initial_state_serializer.rb
- config/locales/simple_form.en.yml
- spec/lib/sanitize_config_spec.rb
Diffstat (limited to 'app/lib/activitypub/activity.rb')
-rw-r--r--app/lib/activitypub/activity.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/lib/activitypub/activity.rb b/app/lib/activitypub/activity.rb
index a4a9baaee..5cd48a6ae 100644
--- a/app/lib/activitypub/activity.rb
+++ b/app/lib/activitypub/activity.rb
@@ -153,6 +153,14 @@ class ActivityPub::Activity
     fetch_remote_original_status
   end
 
+  def follow_request_from_object
+    @follow_request ||= FollowRequest.find_by(target_account: @account, uri: object_uri) unless object_uri.nil?
+  end
+
+  def follow_from_object
+    @follow ||= Follow.find_by(target_account: @account, uri: object_uri) unless object_uri.nil?
+  end
+
   def fetch_remote_original_status
     if object_uri.start_with?('http')
       return if ActivityPub::TagManager.instance.local_uri?(object_uri)