mirror of
				https://codeberg.org/forgejo/forgejo.git
				synced 2025-10-31 06:21:11 +00:00 
			
		
		
		
	This PR is part of #4767. It contains * a refactoring of validation error messages * adds the ability to send user-activities to distant federated servers Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8792 Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org> Co-authored-by: Michael Jerger <michael.jerger@meissa-gmbh.de> Co-committed-by: Michael Jerger <michael.jerger@meissa-gmbh.de>
		
			
				
	
	
		
			22 lines
		
	
	
	
		
			662 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			22 lines
		
	
	
	
		
			662 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| // Copyright 2024 The Forgejo Authors. All rights reserved.
 | |
| // SPDX-License-Identifier: MIT
 | |
| 
 | |
| package federation
 | |
| 
 | |
| import (
 | |
| 	"net/http"
 | |
| 
 | |
| 	"forgejo.org/modules/log"
 | |
| 
 | |
| 	ap "github.com/go-ap/activitypub"
 | |
| )
 | |
| 
 | |
| func processPersonInboxAccept(activity *ap.Activity) (ServiceResult, error) {
 | |
| 	if activity.Object.GetType() != ap.FollowType {
 | |
| 		log.Error("Invalid object type for Accept activity: %v", activity.Object.GetType())
 | |
| 		return ServiceResult{}, NewErrNotAcceptablef("invalid object type for Accept activity: %v", activity.Object.GetType())
 | |
| 	}
 | |
| 
 | |
| 	// We currently do not do anything here, we just drop it.
 | |
| 	return NewServiceResultStatusOnly(http.StatusNoContent), nil
 | |
| }
 |