mirror of
				https://github.com/superseriousbusiness/gotosocial.git
				synced 2025-10-31 08:22:27 -05:00 
			
		
		
		
	[bugfix] Ensure Account and TargetAccount set when doing UndoFollow (#4118)
Closes https://codeberg.org/superseriousbusiness/gotosocial/issues/4112 by ensuring that Account and TargetAccount are properly set on the follow passed through to UndoFollow. Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4118 Co-authored-by: tobi <tobi.smethurst@protonmail.com> Co-committed-by: tobi <tobi.smethurst@protonmail.com>
This commit is contained in:
		
					parent
					
						
							
								bad427e7f0
							
						
					
				
			
			
				commit
				
					
						c15002d76e
					
				
			
		
					 1 changed files with 7 additions and 7 deletions
				
			
		|  | @ -258,13 +258,9 @@ func (p *Processor) unfollow(ctx context.Context, requestingAccount *gtsmodel.Ac | |||
| 		msgs = append(msgs, &messages.FromClientAPI{ | ||||
| 			APObjectType:   ap.ActivityFollow, | ||||
| 			APActivityType: ap.ActivityUndo, | ||||
| 			GTSModel: >smodel.Follow{ | ||||
| 				AccountID:       requestingAccount.ID, | ||||
| 				TargetAccountID: targetAccount.ID, | ||||
| 				URI:             follow.URI, | ||||
| 			}, | ||||
| 			Origin: requestingAccount, | ||||
| 			Target: targetAccount, | ||||
| 			GTSModel:       follow, | ||||
| 			Origin:         requestingAccount, | ||||
| 			Target:         targetAccount, | ||||
| 		}) | ||||
| 	} | ||||
| 
 | ||||
|  | @ -294,9 +290,13 @@ func (p *Processor) unfollow(ctx context.Context, requestingAccount *gtsmodel.Ac | |||
| 		msgs = append(msgs, &messages.FromClientAPI{ | ||||
| 			APObjectType:   ap.ActivityFollow, | ||||
| 			APActivityType: ap.ActivityUndo, | ||||
| 			// Dummy out a follow to undo, | ||||
| 			// based on the follow request. | ||||
| 			GTSModel: >smodel.Follow{ | ||||
| 				AccountID:       requestingAccount.ID, | ||||
| 				Account:         requestingAccount, | ||||
| 				TargetAccountID: targetAccount.ID, | ||||
| 				TargetAccount:   targetAccount, | ||||
| 				URI:             followReq.URI, | ||||
| 			}, | ||||
| 			Origin: requestingAccount, | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue