th: activitypub: resolve quoted objects when new create activities are received
This commit is contained in:
		
							parent
							
								
									21f3328744
								
							
						
					
					
						commit
						1031a532f7
					
				
					 1 changed files with 8 additions and 0 deletions
				
			
		|  | @ -126,6 +126,7 @@ class ActivityPub::Activity::Create < ActivityPub::Activity | |||
|         conversation: conversation_from_uri(@object['conversation']), | ||||
|         media_attachment_ids: process_attachments.take(4).map(&:id), | ||||
|         poll: process_poll, | ||||
|         quote: quote_from_url(@object['quoteUrl']), | ||||
|       } | ||||
|     end | ||||
|   end | ||||
|  | @ -426,4 +427,11 @@ class ActivityPub::Activity::Create < ActivityPub::Activity | |||
|     poll.reload | ||||
|     retry | ||||
|   end | ||||
| 
 | ||||
|   def quote_from_url(url) | ||||
|     return nil if url.nil? | ||||
| 
 | ||||
|     quote = ResolveURLService.new.call(url) | ||||
|     status_from_uri(quote.uri) if quote | ||||
|   end | ||||
| end | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue