mirror of
				https://github.com/superseriousbusiness/gotosocial.git
				synced 2025-10-31 04:12:25 -05:00 
			
		
		
		
	[chore] Tidy up status deletion, remove from cache too (#845)
* add func for deleting status from db + cache * move deletes entirely back to processor and also only do a delete if the requesting account owns the item being deleted * tidy up unboost processing * delete status more efficiently * fix wrong account id on remote test attachments * fix federator test
This commit is contained in:
		
					parent
					
						
							
								8c20626c51
							
						
					
				
			
			
				commit
				
					
						4cf76a2bfc
					
				
			
		
					 12 changed files with 113 additions and 94 deletions
				
			
		|  | @ -78,14 +78,8 @@ func (p *processor) Unboost(ctx context.Context, requestingAccount *gtsmodel.Acc | |||
| 	} | ||||
| 
 | ||||
| 	if toUnboost { | ||||
| 		// we had a boost, so take some action to get rid of it | ||||
| 		if err := p.db.DeleteWhere(ctx, where, >smodel.Status{}); err != nil { | ||||
| 			return nil, gtserror.NewErrorInternalError(fmt.Errorf("error unboosting status: %s", err)) | ||||
| 		} | ||||
| 
 | ||||
| 		// pin some stuff onto the boost while we have it out of the db | ||||
| 		gtsBoost.Account = requestingAccount | ||||
| 
 | ||||
| 		gtsBoost.BoostOf = targetStatus | ||||
| 		gtsBoost.BoostOfAccount = targetStatus.Account | ||||
| 		gtsBoost.BoostOf.Account = targetStatus.Account | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue