mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
[feature] Enable federation in/out of profile PropertyValue fields (#1722)
Co-authored-by: kim <grufwub@gmail.com> Co-authored-by: kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com>
This commit is contained in:
@@ -49,7 +49,7 @@ func (suite *NormalizeTestSuite) jsonToType(rawJson string) (vocab.Type, map[str
|
||||
}
|
||||
|
||||
func (suite *NormalizeTestSuite) typeToJson(t vocab.Type) string {
|
||||
m, err := streams.Serialize(t)
|
||||
m, err := ap.Serialize(t)
|
||||
if err != nil {
|
||||
suite.FailNow(err.Error())
|
||||
}
|
||||
@@ -223,7 +223,7 @@ func (suite *NormalizeTestSuite) TestNormalizeActivityObject() {
|
||||
note,
|
||||
)
|
||||
|
||||
ap.NormalizeActivityObject(create, map[string]interface{}{"object": rawNote})
|
||||
ap.NormalizeIncomingActivityObject(create, map[string]interface{}{"object": rawNote})
|
||||
suite.Equal(`UPDATE: As of this morning there are now more than 7 million Mastodon users, most from the <a class="hashtag" data-tag="twittermigration" href="https://example.org/tag/twittermigration" rel="tag ugc">#TwitterMigration</a>.<br><br>In fact, 100,000 new accounts have been created since last night.<br><br>Since last night's spike 8,000-12,000 new accounts are being created every hour.<br><br>Yesterday, I estimated that Mastodon would have 8 million users by the end of the week. That might happen a lot sooner if this trend continues.`, ap.ExtractContent(note))
|
||||
}
|
||||
|
||||
@@ -248,7 +248,7 @@ func (suite *NormalizeTestSuite) TestNormalizeStatusableAttachmentsOneAttachment
|
||||
}`, suite.typeToJson(note))
|
||||
|
||||
// Normalize it!
|
||||
ap.NormalizeAttachments(note, rawNote)
|
||||
ap.NormalizeIncomingAttachments(note, rawNote)
|
||||
|
||||
// After normalization, the 'name' field of the
|
||||
// attachment should no longer be all jacked up.
|
||||
@@ -289,7 +289,7 @@ func (suite *NormalizeTestSuite) TestNormalizeStatusableAttachmentsOneAttachment
|
||||
}`, suite.typeToJson(note))
|
||||
|
||||
// Normalize it!
|
||||
ap.NormalizeAttachments(note, rawNote)
|
||||
ap.NormalizeIncomingAttachments(note, rawNote)
|
||||
|
||||
// After normalization, the 'name' field of the
|
||||
// attachment should no longer be all jacked up.
|
||||
@@ -349,7 +349,7 @@ func (suite *NormalizeTestSuite) TestNormalizeStatusableAttachmentsMultipleAttac
|
||||
}`, suite.typeToJson(note))
|
||||
|
||||
// Normalize it!
|
||||
ap.NormalizeAttachments(note, rawNote)
|
||||
ap.NormalizeIncomingAttachments(note, rawNote)
|
||||
|
||||
// After normalization, the 'name' field of the
|
||||
// attachment should no longer be all jacked up.
|
||||
@@ -392,7 +392,7 @@ func (suite *NormalizeTestSuite) TestNormalizeAccountableSummary() {
|
||||
accountable, rawAccount := suite.getAccountable()
|
||||
suite.Equal(`about: I'm a #Barbie%20%23girl%20in%20a%20%23Barbie%20%23world%0ALife%20in%20plastic,%20it%27s%20fantastic%0AYou%20can%20brush%20my%20hair,%20undress%20me%20everywhere%0AImagination,%20life%20is%20your%20creation%0AI%27m%20a%20blonde%20bimbo%20girl%0AIn%20a%20fantasy%20world%0ADress%20me%20up,%20make%20it%20tight%0AI%27m%20your%20dolly%0AYou%27re%20my%20doll,%20rock%20and%20roll%0AFeel%20the%20glamour%20in%20pink%0AKiss%20me%20here,%20touch%20me%20there%0AHanky%20panky`, ap.ExtractSummary(accountable))
|
||||
|
||||
ap.NormalizeSummary(accountable, rawAccount)
|
||||
ap.NormalizeIncomingSummary(accountable, rawAccount)
|
||||
suite.Equal(`about: I'm a #Barbie #girl in a #Barbie #world
|
||||
Life in plastic, it's fantastic
|
||||
You can brush my hair, undress me everywhere
|
||||
@@ -411,7 +411,7 @@ func (suite *NormalizeTestSuite) TestNormalizeStatusableSummary() {
|
||||
statusable, rawAccount := suite.getStatusableWithWeirdSummaryAndName()
|
||||
suite.Equal(`warning: #WEIRD%20%23SUMMARY%20;;;;a;;a;asv%20%20%20%20khop8273987(*%5E&%5E)`, ap.ExtractSummary(statusable))
|
||||
|
||||
ap.NormalizeSummary(statusable, rawAccount)
|
||||
ap.NormalizeIncomingSummary(statusable, rawAccount)
|
||||
suite.Equal(`warning: #WEIRD #SUMMARY ;;;;a;;a;asv khop8273987(*^&^)`, ap.ExtractSummary(statusable))
|
||||
}
|
||||
|
||||
@@ -419,7 +419,7 @@ func (suite *NormalizeTestSuite) TestNormalizeStatusableName() {
|
||||
statusable, rawAccount := suite.getStatusableWithWeirdSummaryAndName()
|
||||
suite.Equal(`warning: #WEIRD%20%23nameEE%20;;;;a;;a;asv%20%20%20%20khop8273987(*%5E&%5E)`, ap.ExtractName(statusable))
|
||||
|
||||
ap.NormalizeName(statusable, rawAccount)
|
||||
ap.NormalizeIncomingName(statusable, rawAccount)
|
||||
suite.Equal(`WARNING: #WEIRD #nameEE ;;;;a;;a;asv khop8273987(*^&^)`, ap.ExtractName(statusable))
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user