diff options
author | FChannel <=> | 2021-02-04 12:33:42 -0800 |
---|---|---|
committer | FChannel <=> | 2021-02-04 12:33:42 -0800 |
commit | 1df70fec27ab5e4aa3dff8521767454be6b5498c (patch) | |
tree | 4902b557879b46f37103ac7a62c62833796c8c22 /client.go | |
parent | f6eecc720abaefb954fda9a26aab78bb1d706ba4 (diff) |
when merging boards into a feed show the board color based on posts restrictions
Diffstat (limited to 'client.go')
-rw-r--r-- | client.go | 18 |
1 files changed, 14 insertions, 4 deletions
@@ -34,6 +34,7 @@ type Board struct{ Domain string TP string Restricted bool + Post ObjectBase } type PageData struct { @@ -85,6 +86,8 @@ func IndexGet(w http.ResponseWriter, r *http.Request, db *sql.DB) { data.Key = *Key data.Board.Domain = Domain data.Board.ModCred, _ = GetPasswordFromSession(r) + data.Board.Actor = actor + data.Board.Post.Actor = &actor t.ExecuteTemplate(w, "layout", data) } @@ -106,12 +109,14 @@ func OutboxGet(w http.ResponseWriter, r *http.Request, db *sql.DB, collection Co returnData.Board.Summary = actor.Summary returnData.Board.InReplyTo = "" returnData.Board.To = actor.Outbox - returnData.Board.Actor.Id = actor.Id + returnData.Board.Actor = *actor returnData.Board.ModCred, _ = GetPasswordFromSession(r) returnData.Board.Domain = Domain returnData.Board.Restricted = actor.Restricted returnData.CurrentPage = page + returnData.Board.Post.Actor = actor + returnData.Board.Captcha = Domain + "/" + GetRandomCaptcha(db) returnData.Board.CaptchaCode = GetCaptchaCode(returnData.Board.Captcha) @@ -232,13 +237,15 @@ func CatalogGet(w http.ResponseWriter, r *http.Request, db *sql.DB, collection C returnData.Board.PrefName = actor.PreferredUsername returnData.Board.InReplyTo = "" returnData.Board.To = actor.Outbox - returnData.Board.Actor.Id = actor.Id + returnData.Board.Actor = *actor returnData.Board.Summary = actor.Summary returnData.Board.ModCred, _ = GetPasswordFromSession(r) returnData.Board.Domain = Domain returnData.Board.Restricted = actor.Restricted returnData.Key = *Key + returnData.Board.Post.Actor = actor + returnData.Board.Captcha = Domain + "/" + GetRandomCaptcha(db) returnData.Board.CaptchaCode = GetCaptchaCode(returnData.Board.Captcha) @@ -276,13 +283,12 @@ func PostGet(w http.ResponseWriter, r *http.Request, db *sql.DB){ returnData.Board.Name = actor.Name returnData.Board.PrefName = actor.PreferredUsername returnData.Board.To = actor.Outbox - returnData.Board.Actor.Id = actor.Id + returnData.Board.Actor = actor returnData.Board.Summary = actor.Summary returnData.Board.ModCred, _ = GetPasswordFromSession(r) returnData.Board.Domain = Domain returnData.Board.Restricted = actor.Restricted - if GetDomainURL(actor) != "" { returnData.Board.Captcha = Domain + "/" + GetRandomCaptcha(db) returnData.Board.CaptchaCode = GetCaptchaCode(returnData.Board.Captcha) @@ -301,6 +307,8 @@ func PostGet(w http.ResponseWriter, r *http.Request, db *sql.DB){ followActors := GetActorsFollowFromName(actor, name) followCollection := GetActorsFollowPostFromId(db, followActors, postId) + returnData.Board.Post.Actor = followCollection.Actor + DeleteRemovedPosts(db, &followCollection) DeleteTombstoneReplies(&followCollection) @@ -318,6 +326,8 @@ func PostGet(w http.ResponseWriter, r *http.Request, db *sql.DB){ returnData.Board.InReplyTo = inReplyTo collection := GetActorCollectionByID(db, inReplyTo) + returnData.Board.Post.Actor = collection.Actor + DeleteRemovedPosts(db, &collection) for i, e := range collection.OrderedItems { |