Deduplicate incoming Create notes
This commit is contained in:
parent
722f44ac9f
commit
21c0a0163a
|
@ -217,6 +217,10 @@ def handle_create(activity):
|
||||||
return
|
return
|
||||||
|
|
||||||
# render the json into an activity object
|
# render the json into an activity object
|
||||||
|
status_id = activity['object']['id']
|
||||||
|
if models.Status.objects.filter(remote_id=status_id).count():
|
||||||
|
return
|
||||||
|
|
||||||
serializer = activitypub.activity_objects[activity['object']['type']]
|
serializer = activitypub.activity_objects[activity['object']['type']]
|
||||||
activity = serializer(**activity['object'])
|
activity = serializer(**activity['object'])
|
||||||
|
|
||||||
|
|
|
@ -76,8 +76,8 @@ class Status(OrderedCollectionPageMixin, BookWyrmModel):
|
||||||
return tags
|
return tags
|
||||||
|
|
||||||
shared_mappings = [
|
shared_mappings = [
|
||||||
ActivityMapping('id', 'remote_id'),
|
|
||||||
ActivityMapping('url', 'remote_id'),
|
ActivityMapping('url', 'remote_id'),
|
||||||
|
ActivityMapping('id', 'remote_id'),
|
||||||
ActivityMapping('inReplyTo', 'reply_parent'),
|
ActivityMapping('inReplyTo', 'reply_parent'),
|
||||||
ActivityMapping('published', 'published_date'),
|
ActivityMapping('published', 'published_date'),
|
||||||
ActivityMapping('attributedTo', 'user'),
|
ActivityMapping('attributedTo', 'user'),
|
||||||
|
|
Loading…
Reference in New Issue