summaryrefslogtreecommitdiff
path: root/internal/ap/extract.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/ap/extract.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/ap/extract.go')
-rw-r--r--internal/ap/extract.go23
1 files changed, 0 insertions, 23 deletions
diff --git a/internal/ap/extract.go b/internal/ap/extract.go
index 3d92fa2ba..987ff5e55 100644
--- a/internal/ap/extract.go
+++ b/internal/ap/extract.go
@@ -328,29 +328,6 @@ func ExtractAttributedToURI(i WithAttributedTo) (*url.URL, error) {
return nil, gtserror.New("couldn't find iri for attributed to")
}
-// ExtractPublished extracts the published time from the given
-// WithPublished. Will return an error if the published property
-// is not set, is not a time.Time, or is zero.
-func ExtractPublished(i WithPublished) (time.Time, error) {
- t := time.Time{}
-
- publishedProp := i.GetActivityStreamsPublished()
- if publishedProp == nil {
- return t, gtserror.New("published prop was nil")
- }
-
- if !publishedProp.IsXMLSchemaDateTime() {
- return t, gtserror.New("published prop was not date time")
- }
-
- t = publishedProp.Get()
- if t.IsZero() {
- return t, gtserror.New("published time was zero")
- }
-
- return t, nil
-}
-
// ExtractIconURI extracts the first URI it can find from
// the given WithIcon which links to a supported image file.
// Input will look something like this: