diff options
author | Takeshi Umeda <noel.yoshiba@gmail.com> | 2019-12-05 04:36:33 +0900 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2019-12-04 20:36:33 +0100 |
commit | f43f1e01840cd0bad7a88c90d9ea44b183a2a15d (patch) | |
tree | 5ec3f032aba9e3fe43cb2a99908a3e0844f7041f /app/lib/activitypub/activity.rb | |
parent | f92ed32df4489210ab0ef557f1df90bc5e97d8e6 (diff) |
Add basic support for group actors (#12071)
* Show badge on group actor in WebUI
* Do not notify in case of by following group actor
* If you mention group actor, also mention group actor followers
* Relax characters that can be used in username (same as Application)
* Revert "Relax characters that can be used in username (same as Application)"
This reverts commit 7e10a137b878d0db1b5252c52106faef5e09ca4b.
* Delete display_name method
Diffstat (limited to 'app/lib/activitypub/activity.rb')
-rw-r--r-- | app/lib/activitypub/activity.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/lib/activitypub/activity.rb b/app/lib/activitypub/activity.rb index cdd40604376..0ca6b92a4f5 100644 --- a/app/lib/activitypub/activity.rb +++ b/app/lib/activitypub/activity.rb @@ -89,7 +89,7 @@ class ActivityPub::Activity def distribute(status) crawl_links(status) - notify_about_reblog(status) if reblog_of_local_account?(status) + notify_about_reblog(status) if reblog_of_local_account?(status) && !reblog_by_following_group_account?(status) notify_about_mentions(status) # Only continue if the status is supposed to have arrived in real-time. @@ -105,6 +105,10 @@ class ActivityPub::Activity status.reblog? && status.reblog.account.local? end + def reblog_by_following_group_account?(status) + status.reblog? && status.account.group? && status.reblog.account.following?(status.account) + end + def notify_about_reblog(status) NotifyService.new.call(status.reblog.account, status) end |