* initial commit * add lists * update permissions * fix waypoint create * needs_full_sync for activitypub trails * fixes build issues * fix list get * further CSRF protection * update API docs * adds rate limiter * fix tiptap mentions * a bit more cleanup of main.go * Fix migration order * fixes reviewed notes * require context for activitpub server calls * improve hashing for identifier * fix copy paste error * fix sync trail/list issues * fix summit log/comment duplicates * adaptions after trail merge * fix dockerignore --------- Co-authored-by: Christian Beutel <> Co-authored-by: slothful-vassal <89943360+slothful-vassal@users.noreply.github.com>
25 lines
487 B
Go
25 lines
487 B
Go
package hooks
|
|
|
|
import (
|
|
"pocketbase/federation"
|
|
|
|
"github.com/pocketbase/pocketbase/core"
|
|
)
|
|
|
|
func CreateFollowHandler() func(e *core.RecordRequestEvent) error {
|
|
return func(e *core.RecordRequestEvent) error {
|
|
e.Next()
|
|
federation.CreateFollowActivity(e.App, e.Record)
|
|
|
|
return nil
|
|
}
|
|
}
|
|
|
|
func DeleteFollowHandler() func(e *core.RecordRequestEvent) error {
|
|
return func(e *core.RecordRequestEvent) error {
|
|
federation.CreateUnfollowActivity(e.App, e.Record)
|
|
|
|
return e.Next()
|
|
}
|
|
}
|