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