mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-24 02:21:04 +00:00
Send activitypub pure mode activities when possible
This commit is contained in:
parent
0682117a06
commit
25e8b3ddeb
1 changed files with 9 additions and 1 deletions
|
@ -184,13 +184,21 @@ class ObjectMixin(ActivitypubMixin):
|
|||
# broadcast Create activities for objects owned by a local user
|
||||
if not user or not user.local:
|
||||
return
|
||||
|
||||
try:
|
||||
software = None
|
||||
# do we have a "pure" activitypub version of this for mastodon?
|
||||
if hasattr(self, 'pure_content'):
|
||||
pure_activity = self.to_create_activity(user, pure=True)
|
||||
self.broadcast(pure_activity, user, software='other')
|
||||
software = 'bookwyrm'
|
||||
# sends to BW only if we just did a pure version for masto
|
||||
activity = self.to_create_activity(user)
|
||||
self.broadcast(activity, user, software=software)
|
||||
except KeyError:
|
||||
# janky as heck, this catches the mutliple inheritence chain
|
||||
# for boosts and ignores this auxilliary broadcast
|
||||
return
|
||||
self.broadcast(activity, user)
|
||||
return
|
||||
|
||||
# --- updating an existing object
|
||||
|
|
Loading…
Reference in a new issue