Changes
25 changed files (+42/-67)
-
-
@@ -774,9 +774,9 @@ func FixNullArchivedRepository(ctx context.Context) (int64, error) {}) } func (r *Repository) GetIRI() string { if strings.Contains(r.OwnerName, "@") { return r.OriginalURL func (repo *Repository) GetIRI() string { if strings.Contains(repo.OwnerName, "@") { return repo.OriginalURL } return setting.AppURL + "api/v1/activitypub/repo/" + r.OwnerName + "/" + r.Name return setting.AppURL + "api/v1/activitypub/repo/" + repo.OwnerName + "/" + repo.Name }
-
-
-
@@ -1,6 +1,5 @@// Copyright 2022 The Gitea Authors. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. // SPDX-License-Identifier: MIT package forgefed
-
-
-
@@ -1,6 +1,5 @@// Copyright 2022 The Gitea Authors. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. // SPDX-License-Identifier: MIT package forgefed
-
-
-
@@ -1,6 +1,5 @@// Copyright 2022 The Gitea Authors. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. // SPDX-License-Identifier: MIT package forgefed
-
-
-
@@ -1,6 +1,5 @@// Copyright 2022 The Gitea Authors. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. // SPDX-License-Identifier: MIT package forgefed
-
-
-
@@ -1,6 +1,5 @@// Copyright 2022 The Gitea Authors. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. // SPDX-License-Identifier: MIT package forgefed
-
-
-
@@ -1,6 +1,5 @@// Copyright 2022 The Gitea Authors. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. // SPDX-License-Identifier: MIT package forgefed
-
-
-
@@ -1,6 +1,5 @@// Copyright 2022 The Gitea Authors. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. // SPDX-License-Identifier: MIT package forgefed
-
-
-
@@ -1,6 +1,5 @@// Copyright 2022 The Gitea Authors. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. // SPDX-License-Identifier: MIT package activitypub
-
-
-
@@ -1,6 +1,5 @@// Copyright 2022 The Gitea Authors. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. // SPDX-License-Identifier: MIT package activitypub
-
-
-
@@ -1,6 +1,5 @@// Copyright 2022 The Gitea Authors. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. // SPDX-License-Identifier: MIT package activitypub
-
-
-
@@ -1,6 +1,5 @@// Copyright 2022 The Gitea Authors. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. // SPDX-License-Identifier: MIT package activitypub
-
-
-
@@ -1,6 +1,5 @@// Copyright 2022 The Gitea Authors. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. // SPDX-License-Identifier: MIT package activitypub
-
-
-
@@ -1,6 +1,5 @@// Copyright 2022 The Gitea Authors. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. // SPDX-License-Identifier: MIT package activitypub
-
-
-
@@ -1,6 +1,5 @@// Copyright 2022 The Gitea Authors. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. // SPDX-License-Identifier: MIT package activitypub
-
-
-
@@ -1,6 +1,5 @@// Copyright 2022 The Gitea Authors. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. // SPDX-License-Identifier: MIT package activitypub
-
-
-
@@ -1,6 +1,5 @@// Copyright 2022 The Gitea Authors. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. // SPDX-License-Identifier: MIT package activitypub
-
@@ -13,34 +12,34 @@ import () // Create Follow activity func Follow(actorUser, followUser *user_model.User) (follow *ap.Follow) { func Follow(actorUser, followUser *user_model.User) *ap.Follow { object := ap.PersonNew(ap.IRI(followUser.LoginName)) follow = ap.FollowNew("", object) follow := ap.FollowNew("", object) follow.Actor = ap.PersonNew(ap.IRI(actorUser.GetIRI())) follow.To = ap.ItemCollection{ap.Item(ap.IRI(followUser.LoginName + "/inbox"))} return return follow } // Create Undo Follow activity func Unfollow(actorUser, followUser *user_model.User) (unfollow *ap.Undo) { unfollow = ap.UndoNew("", Follow(actorUser, followUser)) func Unfollow(actorUser, followUser *user_model.User) *ap.Undo { unfollow := ap.UndoNew("", Follow(actorUser, followUser)) unfollow.Actor = ap.PersonNew(ap.IRI(actorUser.GetIRI())) unfollow.To = ap.ItemCollection{ap.Item(ap.IRI(followUser.LoginName + "/inbox"))} return return unfollow } // Create Like activity func Star(user *user_model.User, repo *repo_model.Repository) (like *ap.Like) { like = ap.LikeNew("", forgefed.RepositoryNew(ap.IRI(repo.GetIRI()))) func Star(user *user_model.User, repo *repo_model.Repository) *ap.Like { like := ap.LikeNew("", forgefed.RepositoryNew(ap.IRI(repo.GetIRI()))) like.Actor = ap.PersonNew(ap.IRI(user.GetIRI())) like.To = ap.ItemCollection{ap.IRI(repo.GetIRI() + "/inbox")} return return like } // Create Undo Like activity func Unstar(user *user_model.User, repo *repo_model.Repository) (unstar *ap.Undo) { unstar = ap.UndoNew("", Star(user, repo)) unstar.Actor = ap.PersonNew(ap.IRI(user.GetIRI())) unstar.To = ap.ItemCollection{ap.IRI(repo.GetIRI() + "/inbox")} return func Unstar(user *user_model.User, repo *repo_model.Repository) *ap.Undo { unlike := ap.UndoNew("", Star(user, repo)) unlike.Actor = ap.PersonNew(ap.IRI(user.GetIRI())) unlike.To = ap.ItemCollection{ap.IRI(repo.GetIRI() + "/inbox")} return unlike }
-
-
-
@@ -1,6 +1,5 @@// Copyright 2022 The Gitea Authors. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. // SPDX-License-Identifier: MIT package activitypub
-
-
-
@@ -1,7 +1,5 @@// Copyright 2022 The Gitea Authors. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. // SPDX-License-Identifier: MIT package activitypub import (
-
-
-
@@ -1,6 +1,5 @@// Copyright 2022 The Gitea Authors. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. // SPDX-License-Identifier: MIT package activitypub
-
-
-
@@ -1,6 +1,5 @@// Copyright 2022 The Gitea Authors. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. // SPDX-License-Identifier: MIT package activitypub
-
-
-
@@ -1,6 +1,5 @@// Copyright 2022 The Gitea Authors. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. // SPDX-License-Identifier: MIT package repository
-
-
-
@@ -1,6 +1,5 @@// Copyright 2021 The Gitea Authors. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. // SPDX-License-Identifier: MIT package integration
-
-
-
@@ -1,6 +1,5 @@// Copyright 2021 The Gitea Authors. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. // SPDX-License-Identifier: MIT package integration
-
-
-
@@ -1,6 +1,5 @@// Copyright 2022 The Gitea Authors. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. // SPDX-License-Identifier: MIT package integration
-