mirror of
				https://github.com/superseriousbusiness/gotosocial.git
				synced 2025-10-31 12:52:25 -05:00 
			
		
		
		
	[bugfix] Clean up boosts of status when the status itself is deleted (#579)
* move status wiping logic to fromcommon.go * delete reblogs of status when a status is deleted * add admin boost of zork to test model * update tests to make them more determinate * Merge branch 'main' into status_reblog_cleanup * move status wiping logic to fromcommon.go * delete reblogs of status when a status is deleted * add admin boost of zork to test model * update tests to make them more determinate * Merge branch 'main' into status_reblog_cleanup * test status delete via client api * go fmt
This commit is contained in:
		
					parent
					
						
							
								f4b0d76cd4
							
						
					
				
			
			
				commit
				
					
						b2810fedf2
					
				
			
		
					 4 changed files with 93 additions and 47 deletions
				
			
		|  | @ -284,27 +284,7 @@ func (p *processor) processDeleteStatusFromClientAPI(ctx context.Context, client | |||
| 		statusToDelete.Account = clientMsg.OriginAccount | ||||
| 	} | ||||
| 
 | ||||
| 	// delete all attachments for this status | ||||
| 	for _, a := range statusToDelete.AttachmentIDs { | ||||
| 		if err := p.mediaProcessor.Delete(ctx, a); err != nil { | ||||
| 			return err | ||||
| 		} | ||||
| 	} | ||||
| 
 | ||||
| 	// delete all mentions for this status | ||||
| 	for _, m := range statusToDelete.MentionIDs { | ||||
| 		if err := p.db.DeleteByID(ctx, m, >smodel.Mention{}); err != nil { | ||||
| 			return err | ||||
| 		} | ||||
| 	} | ||||
| 
 | ||||
| 	// delete all notifications for this status | ||||
| 	if err := p.db.DeleteWhere(ctx, []db.Where{{Key: "status_id", Value: statusToDelete.ID}}, &[]*gtsmodel.Notification{}); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 
 | ||||
| 	// delete this status from any and all timelines | ||||
| 	if err := p.deleteStatusFromTimelines(ctx, statusToDelete); err != nil { | ||||
| 	if err := p.wipeStatus(ctx, statusToDelete); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue