aboutsummaryrefslogtreecommitdiff
path: root/db/follow.go
diff options
context:
space:
mode:
authorFChannel <>2022-05-07 21:21:38 -0700
committerFChannel <>2022-06-19 12:53:29 -0700
commitf7bf818d29393ceaccf4d2906557351fa6a4f49f (patch)
tree723e542c8cf0db1e7e64923718977138db77b58d /db/follow.go
parent3c5eebf6275e6d202f8a7b7f027aabcda5c1f332 (diff)
added error func and general cleanup/organization
Diffstat (limited to 'db/follow.go')
-rw-r--r--db/follow.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/db/follow.go b/db/follow.go
index e3c0583..3932ea1 100644
--- a/db/follow.go
+++ b/db/follow.go
@@ -77,7 +77,7 @@ func SetActorFollowingDB(activity activitypub.Activity) (activitypub.Activity, e
if alreadyFollowing && alreadyFollower {
query = `delete from following where id=$1 and following=$2`
activity.Summary = activity.Object.Actor + " Unfollowing " + activity.Actor.Id
- if res, err := activitypub.IsActorLocal(activity.Actor.Id); err == nil && !res {
+ if res, err := activity.Actor.IsLocal(); err == nil && !res {
go activity.Actor.DeleteCache()
} else {
return activity, err
@@ -95,7 +95,7 @@ func SetActorFollowingDB(activity activitypub.Activity) (activitypub.Activity, e
query = `insert into following (id, following) values ($1, $2)`
activity.Summary = activity.Object.Actor + " Following " + activity.Actor.Id
- if res, err := activitypub.IsActorLocal(activity.Actor.Id); err == nil && !res {
+ if res, err := activity.Actor.IsLocal(); err == nil && !res {
go WriteActorToCache(activity.Actor.Id)
}
if _, err := config.DB.Exec(query, activity.Object.Actor, activity.Actor.Id); err != nil {
@@ -197,7 +197,7 @@ func MakeActivityRequestOutbox(activity activitypub.Activity) error {
if activity.Actor.Id == config.Domain {
instance = re.ReplaceAllString(config.Domain, "")
} else {
- _, instance = activitypub.GetActorInstance(activity.Actor.Id)
+ _, instance = activitypub.GetActorAndInstance(activity.Actor.Id)
}
date := time.Now().UTC().Format(time.RFC1123)
@@ -233,7 +233,7 @@ func MakeActivityRequest(activity activitypub.Activity) error {
}
if actor.Id != "" {
- _, instance := activitypub.GetActorInstance(actor.Id)
+ _, instance := activitypub.GetActorAndInstance(actor.Id)
if actor.Inbox != "" {
req, err := http.NewRequest("POST", actor.Inbox, bytes.NewBuffer(j))