mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-08-19 17:01:12 +00:00
Sent user activities to distant federated server (#8792)
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>
This commit is contained in:
parent
6b6fa21b25
commit
c081f20776
22 changed files with 885 additions and 130 deletions
|
@ -19,6 +19,7 @@ import (
|
|||
"forgejo.org/modules/repository"
|
||||
"forgejo.org/modules/setting"
|
||||
"forgejo.org/modules/util"
|
||||
federation_service "forgejo.org/services/federation"
|
||||
notify_service "forgejo.org/services/notify"
|
||||
)
|
||||
|
||||
|
@ -40,21 +41,19 @@ func NewNotifier() notify_service.Notifier {
|
|||
}
|
||||
|
||||
func notifyAll(ctx context.Context, action *activities_model.Action) error {
|
||||
_, err := activities_model.NotifyWatchers(ctx, action)
|
||||
out, err := activities_model.NotifyWatchers(ctx, action)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return err
|
||||
// return federation_service.NotifyActivityPubFollowers(ctx, out)
|
||||
return federation_service.NotifyActivityPubFollowers(ctx, out)
|
||||
}
|
||||
|
||||
func notifyAllActions(ctx context.Context, acts []*activities_model.Action) error {
|
||||
_, err := activities_model.NotifyWatchersActions(ctx, acts)
|
||||
out, err := activities_model.NotifyWatchersActions(ctx, acts)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
// return federation_service.NotifyActivityPubFollowers(ctx, out)
|
||||
return federation_service.NotifyActivityPubFollowers(ctx, out)
|
||||
}
|
||||
|
||||
func (a *actionNotifier) NewIssue(ctx context.Context, issue *issues_model.Issue, mentions []*user_model.User) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue