diff options
author | FChannel <> | 2022-05-02 12:44:41 -0700 |
---|---|---|
committer | FChannel <> | 2022-06-19 12:53:29 -0700 |
commit | 1ee6552559141dd5dba91abec7c81d68c56abda0 (patch) | |
tree | 4ac21571a27980e8ebf83a065c270b36cc3ecfd6 /outboxGet.go | |
parent | 733f911fadc872933481bcbe087d519ce00372df (diff) |
removed all unneeded .go files from root directory
Diffstat (limited to 'outboxGet.go')
-rw-r--r-- | outboxGet.go | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/outboxGet.go b/outboxGet.go deleted file mode 100644 index 27e9cc4..0000000 --- a/outboxGet.go +++ /dev/null @@ -1,46 +0,0 @@ -package main - -import ( - "net/http" - - "encoding/json" - - "github.com/FChannel0/FChannel-Server/activitypub" - "github.com/FChannel0/FChannel-Server/config" - "github.com/FChannel0/FChannel-Server/webfinger" - _ "github.com/lib/pq" -) - -func GetActorOutbox(w http.ResponseWriter, r *http.Request) error { - actor, err := webfinger.GetActorFromPath(r.URL.Path, "/") - if err != nil { - return err - } - - var collection activitypub.Collection - - c, err := activitypub.GetActorObjectCollectionFromDB(actor.Id) - if err != nil { - return err - } - collection.OrderedItems = c.OrderedItems - - collection.AtContext.Context = "https://www.w3.org/ns/activitystreams" - collection.Actor = &actor - - collection.TotalItems, err = activitypub.GetObjectPostsTotalDB(actor) - if err != nil { - return err - } - - collection.TotalImgs, err = activitypub.GetObjectImgsTotalDB(actor) - if err != nil { - return err - } - - enc, _ := json.Marshal(collection) - - w.Header().Set("Content-Type", config.ActivityStreams) - _, err = w.Write(enc) - return err -} |