Work on AP-ing media and extending likes and whatnot
All checks were successful
/ docker (push) Successful in 1m56s
All checks were successful
/ docker (push) Successful in 1m56s
Also added two fields to roles model, but haven't ran the various generators yet
This commit is contained in:
parent
1fcf47bffc
commit
81a01fbf8b
10 changed files with 59 additions and 4 deletions
|
@ -122,6 +122,11 @@ func postAs(w http.ResponseWriter, r *http.Request) {
|
|||
return
|
||||
}
|
||||
err = tx.NoteToPing.Create(dbPings...)
|
||||
if err != nil {
|
||||
log.Error().Err(err).Msg("Failed to create note pings in db")
|
||||
_ = webutils.ProblemDetailsStatusOnly(w, http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
activity := models.Activity{
|
||||
Id: shared.NewId(),
|
||||
Type: string(models.ActivityCreate),
|
||||
|
|
|
@ -1 +1,5 @@
|
|||
package activitypub
|
||||
|
||||
import "net/http"
|
||||
|
||||
func activityLike(w http.ResponseWriter, r *http.Request) {}
|
||||
|
|
5
web/public/api/activitypub/objectEmote.go
Normal file
5
web/public/api/activitypub/objectEmote.go
Normal file
|
@ -0,0 +1,5 @@
|
|||
package activitypub
|
||||
|
||||
import "net/http"
|
||||
|
||||
func objectEmote(w http.ResponseWriter, r *http.Request) {}
|
|
@ -16,7 +16,9 @@ func BuildActivitypubRouter() http.Handler {
|
|||
router.HandleFunc("GET /activity/reject/{id}", activityReject)
|
||||
router.HandleFunc("GET /activity/update/{id}", activityUpdate)
|
||||
router.HandleFunc("GET /activity/follow/{id}", activityFollow)
|
||||
router.HandleFunc("GET /activity/like/{id}", activityLike)
|
||||
router.HandleFunc("GET /note/{id}", objectNote)
|
||||
router.HandleFunc("GET /note/{id}/reactions", noteReactions)
|
||||
router.HandleFunc("GET /emote/{id}", objectEmote)
|
||||
return router
|
||||
}
|
||||
|
|
|
@ -236,7 +236,7 @@ func postPostRequest(resp *http.Response, reqErr error, dbId uint64) {
|
|||
// If response status is ok (< 400) delete entry in db to not process it again
|
||||
if resp.StatusCode < 400 {
|
||||
update = false
|
||||
fr.Where(fr.Id.Eq(dbId)).Delete()
|
||||
_, _ = fr.Where(fr.Id.Eq(dbId)).Delete()
|
||||
return
|
||||
}
|
||||
if resp.StatusCode == 429 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue