mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-19 21:37:29 -06:00
start on federating faves
This commit is contained in:
parent
2dbd132e50
commit
5219a7b9e7
5 changed files with 69 additions and 5 deletions
|
|
@ -186,10 +186,20 @@ func (p *processor) StatusFave(authed *oauth.Auth, targetStatusID string) (*apim
|
|||
}
|
||||
|
||||
// it's visible! it's faveable! so let's fave the FUCK out of it
|
||||
_, err = p.db.FaveStatus(targetStatus, authed.Account.ID)
|
||||
gtsFave, err := p.db.FaveStatus(targetStatus, authed.Account.ID)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error faveing status: %s", err)
|
||||
}
|
||||
gtsFave.FavedStatus = targetStatus // pin a pointer to the target status to the fave for convenience later on
|
||||
|
||||
// send the new fave through the processor channel for federation etc
|
||||
p.fromClientAPI <- gtsmodel.FromClientAPI{
|
||||
APObjectType: gtsmodel.ActivityStreamsLike,
|
||||
APActivityType: gtsmodel.ActivityStreamsCreate,
|
||||
GTSModel: gtsFave,
|
||||
OriginAccount: authed.Account,
|
||||
TargetAccount: targetAccount,
|
||||
}
|
||||
|
||||
var boostOfStatus *gtsmodel.Status
|
||||
if targetStatus.BoostOfID != "" {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue