Merge pull request #263 from mouse-reeve/delete

Send Delete activity, not Tombstone on deletion
This commit is contained in:
Mouse Reeve 2020-10-31 11:05:07 -07:00 committed by GitHub
commit fd76d1a585
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 2 deletions

View file

@ -26,7 +26,6 @@ class Delete(Verb):
''' Create activity ''' ''' Create activity '''
to: List to: List
cc: List cc: List
signature: Signature
type: str = 'Delete' type: str = 'Delete'

View file

@ -108,6 +108,20 @@ class ActivitypubMixin:
).serialize() ).serialize()
def to_delete_activity(self, user):
''' notice of deletion '''
# this should be a tombstone
activity_object = self.to_activity()
return activitypub.Delete(
id=self.remote_id + '/activity',
actor=user.remote_id,
to=['%s/followers' % user.remote_id],
cc=['https://www.w3.org/ns/activitystreams#Public'],
object=activity_object,
).serialize()
def to_update_activity(self, user): def to_update_activity(self, user):
''' wrapper for Updates to an activity ''' ''' wrapper for Updates to an activity '''
activity_id = '%s#update/%s' % (user.remote_id, uuid4()) activity_id = '%s#update/%s' % (user.remote_id, uuid4())

View file

@ -204,7 +204,7 @@ def handle_imported_book(user, item, include_reviews, privacy):
def handle_delete_status(user, status): def handle_delete_status(user, status):
''' delete a status and broadcast deletion to other servers ''' ''' delete a status and broadcast deletion to other servers '''
delete_status(status) delete_status(status)
broadcast(user, status.to_activity()) broadcast(user, status.to_delete_activity(user))
def handle_status(user, form): def handle_status(user, form):