mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-12-15 04:36:34 +00:00
Merge branch 'main' into production
This commit is contained in:
commit
4c8583bfdb
3 changed files with 5 additions and 6 deletions
|
@ -151,9 +151,9 @@ class ActivitypubMixin:
|
||||||
return self.activity_serializer(**activity).serialize()
|
return self.activity_serializer(**activity).serialize()
|
||||||
|
|
||||||
|
|
||||||
def to_create_activity(self, user):
|
def to_create_activity(self, user, **kwargs):
|
||||||
''' returns the object wrapped in a Create activity '''
|
''' returns the object wrapped in a Create activity '''
|
||||||
activity_object = self.to_activity()
|
activity_object = self.to_activity(**kwargs)
|
||||||
|
|
||||||
signer = pkcs1_15.new(RSA.import_key(user.key_pair.private_key))
|
signer = pkcs1_15.new(RSA.import_key(user.key_pair.private_key))
|
||||||
content = activity_object['content']
|
content = activity_object['content']
|
||||||
|
|
|
@ -78,7 +78,7 @@ class Status(OrderedCollectionPageMixin, BookWyrmModel):
|
||||||
activity['replies'] = self.to_replies()
|
activity['replies'] = self.to_replies()
|
||||||
|
|
||||||
# "pure" serialization for non-bookwyrm instances
|
# "pure" serialization for non-bookwyrm instances
|
||||||
if pure:
|
if pure and hasattr(self, 'pure_content'):
|
||||||
activity['content'] = self.pure_content
|
activity['content'] = self.pure_content
|
||||||
if 'name' in activity:
|
if 'name' in activity:
|
||||||
activity['name'] = self.pure_name
|
activity['name'] = self.pure_name
|
||||||
|
|
|
@ -252,9 +252,8 @@ def handle_status(user, form):
|
||||||
broadcast(user, status.to_create_activity(user), software='bookwyrm')
|
broadcast(user, status.to_create_activity(user), software='bookwyrm')
|
||||||
|
|
||||||
# re-format the activity for non-bookwyrm servers
|
# re-format the activity for non-bookwyrm servers
|
||||||
if hasattr(status, 'pure_activity_serializer'):
|
remote_activity = status.to_create_activity(user, pure=True)
|
||||||
remote_activity = status.to_create_activity(user, pure=True)
|
broadcast(user, remote_activity, software='other')
|
||||||
broadcast(user, remote_activity, software='other')
|
|
||||||
|
|
||||||
|
|
||||||
def handle_tag(user, tag):
|
def handle_tag(user, tag):
|
||||||
|
|
Loading…
Reference in a new issue