mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
[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
This commit is contained in:
@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user