[bugfix/chore] Announce reliability updates (#2405)

* [bugfix/chore] `Announce` updates

* test update

* fix tests

* TestParseAnnounce

* update comments

* don't lock/unlock, change function signature

* naming stuff

* don't check domain block twice

* UnwrapIfBoost

* beep boop
This commit is contained in:
tobi
2023-12-01 15:27:15 +01:00
committed by GitHub
parent d1cac53cbb
commit 0e2c342191
15 changed files with 425 additions and 285 deletions

View File

@@ -20,6 +20,7 @@ package web
import (
"context"
"encoding/json"
"errors"
"fmt"
"net/http"
"strings"
@@ -124,6 +125,13 @@ func (m *Module) threadGETHandler(c *gin.Context) {
return
}
// Don't render boosts/reblogs as top-level statuses.
if status.Reblog != nil {
err := errors.New("status is a boost wrapper / reblog")
apiutil.WebErrorHandler(c, gtserror.NewErrorNotFound(err), instanceGet)
return
}
// Fill in the rest of the thread context.
context, errWithCode := m.processor.Status().WebContextGet(ctx, targetStatusID)
if errWithCode != nil {