summaryrefslogtreecommitdiff
path: root/internal/ap/resolve.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2023-04-26 17:17:22 +0200
committerLibravatar GitHub <noreply@github.com>2023-04-26 16:17:22 +0100
commit6b4f6dc7555e4a4a632ee1654596b8ed4d09853e (patch)
treeb168528d0a0003e908b16192882dbe5e4752448a /internal/ap/resolve.go
parent[docs] Migrates Chart Location (#1708) (diff)
downloadgotosocial-6b4f6dc7555e4a4a632ee1654596b8ed4d09853e.tar.xz
[bugfix] Fix remaining mangled URI escaping issues in statuses + accounts (#1712)
* start fiddling with normalize + extract functions * normalize attachment name (image description) * NormalizeAccountableSummary * normalize summary + name
Diffstat (limited to 'internal/ap/resolve.go')
-rw-r--r--internal/ap/resolve.go12
1 files changed, 9 insertions, 3 deletions
diff --git a/internal/ap/resolve.go b/internal/ap/resolve.go
index c5c9efd65..8d116751c 100644
--- a/internal/ap/resolve.go
+++ b/internal/ap/resolve.go
@@ -27,8 +27,7 @@ import (
)
// ResolveStatusable tries to resolve the given bytes into an ActivityPub Statusable representation.
-// It will then perform normalization on the Statusable by calling NormalizeStatusable, so that
-// callers don't need to bother doing extra steps.
+// It will then perform normalization on the Statusable.
//
// Works for: Article, Document, Image, Video, Note, Page, Event, Place, Profile
func ResolveStatusable(ctx context.Context, b []byte) (Statusable, error) {
@@ -73,11 +72,16 @@ func ResolveStatusable(ctx context.Context, b []byte) (Statusable, error) {
return nil, newErrWrongType(err)
}
- NormalizeStatusableContent(statusable, rawStatusable)
+ NormalizeContent(statusable, rawStatusable)
+ NormalizeAttachments(statusable, rawStatusable)
+ NormalizeSummary(statusable, rawStatusable)
+ NormalizeName(statusable, rawStatusable)
+
return statusable, nil
}
// ResolveStatusable tries to resolve the given bytes into an ActivityPub Accountable representation.
+// It will then perform normalization on the Accountable.
//
// Works for: Application, Group, Organization, Person, Service
func ResolveAccountable(ctx context.Context, b []byte) (Accountable, error) {
@@ -114,5 +118,7 @@ func ResolveAccountable(ctx context.Context, b []byte) (Accountable, error) {
return nil, newErrWrongType(err)
}
+ NormalizeSummary(accountable, rawAccountable)
+
return accountable, nil
}