diff options
author | FChannel <> | 2021-06-24 23:45:18 -0700 |
---|---|---|
committer | FChannel <> | 2021-06-24 23:45:18 -0700 |
commit | ef7eb7330018c84a44fb24711982c25f51749d2e (patch) | |
tree | 8da97fce2dad238b994eede1f0b9ce2bf9b3a7ff /outboxPost.go | |
parent | b4f7d00ad9d13f96323366ded2eb7702e37f6e52 (diff) |
changed activitystream formating for objects to better align with pleromas actor field
Diffstat (limited to 'outboxPost.go')
-rw-r--r-- | outboxPost.go | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/outboxPost.go b/outboxPost.go index c5e582a..774ac62 100644 --- a/outboxPost.go +++ b/outboxPost.go @@ -43,9 +43,7 @@ func ParseOutboxRequest(w http.ResponseWriter, r *http.Request, db *sql.DB) { var nObj = CreateObject("Note") nObj = ObjectFromForm(r, db, nObj) - var act Actor - nObj.Actor = &act - nObj.Actor.Id = Domain + "/" + actor.Name + nObj.Actor = Domain + "/" + actor.Name nObj = WriteObjectToDB(db, nObj) activity := CreateActivity("Create", nObj) @@ -88,9 +86,9 @@ func ParseOutboxRequest(w http.ResponseWriter, r *http.Request, db *sql.DB) { var validActor bool var validLocalActor bool - validActor = (activity.Object.Actor.Id != "") + validActor = (activity.Object.Actor != "") validLocalActor = (activity.Actor.Id == actor.Id) - + var rActivity Activity if validActor && validLocalActor { rActivity = AcceptFollow(activity) @@ -114,10 +112,10 @@ func ParseOutboxRequest(w http.ResponseWriter, r *http.Request, db *sql.DB) { break case "New": - name := activity.Object.Actor.Name - prefname := activity.Object.Actor.PreferredUsername - summary := activity.Object.Actor.Summary - restricted := activity.Object.Actor.Restricted + name := activity.Object.Alias + prefname := activity.Object.Name + summary := activity.Object.Summary + restricted := activity.Object.Sensitive actor := CreateNewBoardDB(db, *CreateNewActor(name, prefname, summary, authReq, restricted)) @@ -368,7 +366,7 @@ func ObjectFromForm(r *http.Request, db *sql.DB, obj ObjectBase) ObjectBase { if originalPost.Id != "" { if !IsActivityLocal(db, activity) { - id := GetActorFromID(originalPost.Id).Id + id := FingerActor(originalPost.Id).Id actor := GetActor(id) if !IsInStringArray(obj.To, actor.Id) { obj.To = append(obj.To, actor.Id) @@ -397,7 +395,7 @@ func ObjectFromForm(r *http.Request, db *sql.DB, obj ObjectBase) ObjectBase { activity.To = append(activity.To, e.Id) if !IsActivityLocal(db, activity) { - id := GetActorFromID(e.Id).Id + id := FingerActor(e.Id).Id actor := GetActor(id) if !IsInStringArray(obj.To, actor.Id) { obj.To = append(obj.To, actor.Id) |