aboutsummaryrefslogtreecommitdiff
path: root/client.go
diff options
context:
space:
mode:
Diffstat (limited to 'client.go')
-rw-r--r--client.go24
1 files changed, 24 insertions, 0 deletions
diff --git a/client.go b/client.go
index 5b183c2..f0a3ed7 100644
--- a/client.go
+++ b/client.go
@@ -187,6 +187,12 @@ func OutboxGet(w http.ResponseWriter, r *http.Request, db *sql.DB, collection Co
orderedReplies = append(orderedReplies, replies[cur])
}
}
+
+ for _, e := range returnData.Posts[i].Replies.OrderedItems {
+ if len(e.Attachment) > 0 {
+ returnData.Posts[i].Replies.TotalImgs = returnData.Posts[i].Replies.TotalImgs + 1
+ }
+ }
returnData.Posts[i].Replies.TotalItems = len(returnData.Posts[i].Replies.OrderedItems)
returnData.Posts[i].Replies.OrderedItems = orderedReplies
@@ -253,6 +259,15 @@ func CatalogGet(w http.ResponseWriter, r *http.Request, db *sql.DB, collection C
returnData.Posts = mergeCollection.OrderedItems
+ for i, _ := range returnData.Posts {
+ for _, e := range returnData.Posts[i].Replies.OrderedItems {
+ if len(e.Attachment) > 0 {
+ returnData.Posts[i].Replies.TotalImgs = returnData.Posts[i].Replies.TotalImgs + 1
+ }
+ }
+ returnData.Posts[i].Replies.TotalItems = len(returnData.Posts[i].Replies.OrderedItems)
+ }
+
t.ExecuteTemplate(w, "layout", returnData)
}
@@ -340,6 +355,15 @@ func PostGet(w http.ResponseWriter, r *http.Request, db *sql.DB){
}
}
+ for i, _ := range returnData.Posts {
+ for _, e := range returnData.Posts[i].Replies.OrderedItems {
+ if len(e.Attachment) > 0 {
+ returnData.Posts[i].Replies.TotalImgs = returnData.Posts[i].Replies.TotalImgs + 1
+ }
+ }
+ returnData.Posts[i].Replies.TotalItems = len(returnData.Posts[i].Replies.OrderedItems)
+ }
+
t.ExecuteTemplate(w, "layout", returnData)
}