mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-21 13:57:29 -06:00
start work on notifications
This commit is contained in:
parent
e670c32a91
commit
5853179728
17 changed files with 437 additions and 5 deletions
|
|
@ -496,6 +496,27 @@ func (f *federatingDB) Create(ctx context.Context, asType vocab.Type) error {
|
|||
return fmt.Errorf("database error accepting follow request: %s", err)
|
||||
}
|
||||
}
|
||||
case gtsmodel.ActivityStreamsLike:
|
||||
like, ok := asType.(vocab.ActivityStreamsLike)
|
||||
if !ok {
|
||||
return errors.New("could not convert type to like")
|
||||
}
|
||||
|
||||
fave, err := f.typeConverter.ASLikeToFave(like)
|
||||
if err != nil {
|
||||
return fmt.Errorf("could not convert Like to fave: %s", err)
|
||||
}
|
||||
|
||||
if err := f.db.Put(fave); err != nil {
|
||||
return fmt.Errorf("database error inserting fave: %s", err)
|
||||
}
|
||||
|
||||
fromFederatorChan <- gtsmodel.FromFederator{
|
||||
APObjectType: gtsmodel.ActivityStreamsLike,
|
||||
APActivityType: gtsmodel.ActivityStreamsCreate,
|
||||
GTSModel: fave,
|
||||
ReceivingAccount: targetAcct,
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue