From 96d70100e46ad536d5e017b215f559a7a0615380 Mon Sep 17 00:00:00 2001 From: f Date: Thu, 14 Mar 2024 17:07:58 -0300 Subject: [PATCH] feat: auto-aprobar solicitudes de seguimiento --- app/models/activity_pub/activity/follow.rb | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/app/models/activity_pub/activity/follow.rb b/app/models/activity_pub/activity/follow.rb index e383490a..393eb3b4 100644 --- a/app/models/activity_pub/activity/follow.rb +++ b/app/models/activity_pub/activity/follow.rb @@ -4,8 +4,17 @@ # # Una actividad de seguimiento se refiere siempre a une actore (el # sitio) y proviene de otre actore. +# +# Por ahora las solicitudes de seguimiento se auto-aprueban. class ActivityPub class Activity - class Follow < ActivityPub::Activity; end + class Follow < ActivityPub::Activity + # Auto-aprobar la solicitud de seguimiento + def update_activity_pub_state! + activity_pub.approve! + rescue Exception => e + ExceptionNotifier.notify_exception(e, { site: activity_pub.site.name, activity: self.id }) + end + end end end