mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-08 18:04:14 +01:00
Merge branch 'forgejo-federated-star' of codeberg.org:meissa/forgejo into forgejo-federated-star
This commit is contained in:
commit
213fc3a97d
3 changed files with 5 additions and 0 deletions
|
@ -74,6 +74,9 @@ func RepositoryInbox(ctx *context.APIContext) {
|
|||
form := web.GetForm(ctx)
|
||||
httpStatus, title, err := federation.ProcessLikeActivity(ctx, form, repository.ID)
|
||||
if err != nil {
|
||||
log.Error("Status: %v", httpStatus)
|
||||
log.Error("Title: %v", title)
|
||||
log.Error("Error: %v", err)
|
||||
ctx.Error(httpStatus, title, err)
|
||||
}
|
||||
ctx.Status(http.StatusNoContent)
|
||||
|
|
|
@ -252,6 +252,7 @@ func SendLikeActivities(ctx context.Context, doer user.User, repoID int64) error
|
|||
|
||||
likeActivityList := make([]forgefed.ForgeLike, 0)
|
||||
for _, followingRepo := range followingRepos {
|
||||
log.Info("Found following repo: %v", followingRepo)
|
||||
target := followingRepo.URI
|
||||
likeActivity, err := forgefed.NewForgeLike(doer.APAPIURL(), target, time.Now())
|
||||
if err != nil {
|
||||
|
|
|
@ -12,6 +12,7 @@ import (
|
|||
"code.gitea.io/gitea/services/federation"
|
||||
)
|
||||
|
||||
// ToDo: Consistent Naming, smth like StarLocalAndFollowingRepo
|
||||
func StarRepoAndFederate(ctx context.Context, doer user.User, repoID int64, star bool) error {
|
||||
if err := repo.StarRepo(ctx, doer.ID, repoID, star); err != nil {
|
||||
return err
|
||||
|
|
Loading…
Reference in a new issue