summaryrefslogtreecommitdiff
path: root/internal/typeutils/util.go
diff options
context:
space:
mode:
authorLibravatar kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com>2023-11-30 16:22:34 +0000
committerLibravatar GitHub <noreply@github.com>2023-11-30 16:22:34 +0000
commiteb170003b81504ba6eb85f950c223dc9eaf1cfca (patch)
treef1f9779e14875faa70f4db85a8cf19100633884d /internal/typeutils/util.go
parent[bugfix] always go through status parent dereferencing on isNew, even on data... (diff)
downloadgotosocial-eb170003b81504ba6eb85f950c223dc9eaf1cfca.tar.xz
[bugfix] return 400 Bad Request on more cases of malformed AS data (#2399)
Diffstat (limited to 'internal/typeutils/util.go')
-rw-r--r--internal/typeutils/util.go18
1 files changed, 0 insertions, 18 deletions
diff --git a/internal/typeutils/util.go b/internal/typeutils/util.go
index 8a8d4123b..2eeada868 100644
--- a/internal/typeutils/util.go
+++ b/internal/typeutils/util.go
@@ -19,7 +19,6 @@ package typeutils
import (
"context"
- "errors"
"fmt"
"net/url"
"path"
@@ -27,7 +26,6 @@ import (
"strconv"
"strings"
- "github.com/superseriousbusiness/gotosocial/internal/ap"
apimodel "github.com/superseriousbusiness/gotosocial/internal/api/model"
"github.com/superseriousbusiness/gotosocial/internal/config"
"github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
@@ -94,22 +92,6 @@ func misskeyReportInlineURLs(content string) []*url.URL {
return urls
}
-// getURI is a shortcut/util function for extracting
-// the JSONLDId URI of an Activity or Object.
-func getURI(withID ap.WithJSONLDId) (*url.URL, string, error) {
- idProp := withID.GetJSONLDId()
- if idProp == nil {
- return nil, "", errors.New("id prop was nil")
- }
-
- if !idProp.IsIRI() {
- return nil, "", errors.New("id prop was not an IRI")
- }
-
- id := idProp.Get()
- return id, id.String(), nil
-}
-
// placeholdUnknownAttachments separates any attachments with type `unknown`
// out of the given slice, and returns an `<aside>` tag containing links to
// those attachments, as well as the slice of remaining "known" attachments.