mirror of
				https://github.com/superseriousbusiness/gotosocial.git
				synced 2025-10-30 19:42:26 -05:00 
			
		
		
		
	[bugfix] Carry-over ApprovedByURI to avoid marking already-approved remote statuses as pending approval (#3231)
		
	* [bugfix] Carry-over pendingApproval + approvedByURI to avoid pending already-approved remote statuses * don't carry over pending_approval, not necessary * comment
This commit is contained in:
		
					parent
					
						
							
								da3fa2d4a2
							
						
					
				
			
			
				commit
				
					
						bef0dfc66c
					
				
			
		
					 1 changed files with 11 additions and 0 deletions
				
			
		|  | @ -514,6 +514,17 @@ func (d *Dereferencer) enrichStatus( | ||||||
| 	latestStatus.FetchedAt = time.Now() | 	latestStatus.FetchedAt = time.Now() | ||||||
| 	latestStatus.Local = status.Local | 	latestStatus.Local = status.Local | ||||||
| 
 | 
 | ||||||
|  | 	// Carry-over approvals. Remote instances might not yet | ||||||
|  | 	// serve statuses with the `approved_by` field, but we | ||||||
|  | 	// might have marked a status as pre-approved on our side | ||||||
|  | 	// based on the author's inclusion in a followers/following | ||||||
|  | 	// collection. By carrying over previously-set values we | ||||||
|  | 	// can avoid marking such statuses as "pending" again. | ||||||
|  | 	// | ||||||
|  | 	// If a remote has in the meantime retracted its approval, | ||||||
|  | 	// the next call to 'isPermittedStatus' will catch that. | ||||||
|  | 	latestStatus.ApprovedByURI = status.ApprovedByURI | ||||||
|  | 
 | ||||||
| 	// Check if this is a permitted status we should accept. | 	// Check if this is a permitted status we should accept. | ||||||
| 	// Function also sets "PendingApproval" bool as necessary. | 	// Function also sets "PendingApproval" bool as necessary. | ||||||
| 	permit, err := d.isPermittedStatus(ctx, requestUser, status, latestStatus) | 	permit, err := d.isPermittedStatus(ctx, requestUser, status, latestStatus) | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue