Deduplicate incoming Create notes
This commit is contained in:
		@@ -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'),
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user