mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
Fix incorrect target being used in CC prop for mentioning statuses (#322)
* hardcode time on admin_account_status_3 * add test for as status with mention * fix incorrect target URI being used for mentions
This commit is contained in:
@ -464,9 +464,9 @@ func (c *converter) StatusToAS(ctx context.Context, s *gtsmodel.Status) (vocab.A
|
||||
case gtsmodel.VisibilityDirect:
|
||||
// if DIRECT, then only mentioned users should be added to TO, and nothing to CC
|
||||
for _, m := range s.Mentions {
|
||||
iri, err := url.Parse(m.OriginAccount.URI)
|
||||
iri, err := url.Parse(m.TargetAccount.URI)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("StatusToAS: error parsing uri %s: %s", m.OriginAccount.URI, err)
|
||||
return nil, fmt.Errorf("StatusToAS: error parsing uri %s: %s", m.TargetAccount.URI, err)
|
||||
}
|
||||
toProp.AppendIRI(iri)
|
||||
}
|
||||
@ -476,9 +476,9 @@ func (c *converter) StatusToAS(ctx context.Context, s *gtsmodel.Status) (vocab.A
|
||||
// if FOLLOWERS ONLY then we want to add followers to TO, and mentions to CC
|
||||
toProp.AppendIRI(authorFollowersURI)
|
||||
for _, m := range s.Mentions {
|
||||
iri, err := url.Parse(m.OriginAccount.URI)
|
||||
iri, err := url.Parse(m.TargetAccount.URI)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("StatusToAS: error parsing uri %s: %s", m.OriginAccount.URI, err)
|
||||
return nil, fmt.Errorf("StatusToAS: error parsing uri %s: %s", m.TargetAccount.URI, err)
|
||||
}
|
||||
ccProp.AppendIRI(iri)
|
||||
}
|
||||
@ -487,9 +487,9 @@ func (c *converter) StatusToAS(ctx context.Context, s *gtsmodel.Status) (vocab.A
|
||||
toProp.AppendIRI(authorFollowersURI)
|
||||
ccProp.AppendIRI(publicURI)
|
||||
for _, m := range s.Mentions {
|
||||
iri, err := url.Parse(m.OriginAccount.URI)
|
||||
iri, err := url.Parse(m.TargetAccount.URI)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("StatusToAS: error parsing uri %s: %s", m.OriginAccount.URI, err)
|
||||
return nil, fmt.Errorf("StatusToAS: error parsing uri %s: %s", m.TargetAccount.URI, err)
|
||||
}
|
||||
ccProp.AppendIRI(iri)
|
||||
}
|
||||
@ -498,9 +498,9 @@ func (c *converter) StatusToAS(ctx context.Context, s *gtsmodel.Status) (vocab.A
|
||||
toProp.AppendIRI(publicURI)
|
||||
ccProp.AppendIRI(authorFollowersURI)
|
||||
for _, m := range s.Mentions {
|
||||
iri, err := url.Parse(m.OriginAccount.URI)
|
||||
iri, err := url.Parse(m.TargetAccount.URI)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("StatusToAS: error parsing uri %s: %s", m.OriginAccount.URI, err)
|
||||
return nil, fmt.Errorf("StatusToAS: error parsing uri %s: %s", m.TargetAccount.URI, err)
|
||||
}
|
||||
ccProp.AppendIRI(iri)
|
||||
}
|
||||
|
Reference in New Issue
Block a user