mirror of
https://github.com/owncast/owncast.git
synced 2024-12-18 15:23:55 +03:00
26 lines
742 B
Go
26 lines
742 B
Go
|
package inbox
|
||
|
|
||
|
import (
|
||
|
"context"
|
||
|
|
||
|
"github.com/go-fed/activity/streams/vocab"
|
||
|
"github.com/owncast/owncast/activitypub/persistence"
|
||
|
"github.com/owncast/owncast/activitypub/resolvers"
|
||
|
log "github.com/sirupsen/logrus"
|
||
|
)
|
||
|
|
||
|
func handleUpdateRequest(c context.Context, activity vocab.ActivityStreamsUpdate) error {
|
||
|
// We only care about update events to followers.
|
||
|
if !activity.GetActivityStreamsObject().At(0).IsActivityStreamsPerson() {
|
||
|
return nil
|
||
|
}
|
||
|
|
||
|
actor, err := resolvers.GetResolvedActorFromActorProperty(activity.GetActivityStreamsActor())
|
||
|
if err != nil {
|
||
|
log.Errorln(err)
|
||
|
return err
|
||
|
}
|
||
|
|
||
|
return persistence.UpdateFollower(actor.ActorIri.String(), actor.Inbox.String(), actor.Name, actor.FullUsername, actor.Image.String())
|
||
|
}
|