diff options
author | FChannel <> | 2021-07-31 16:35:42 -0700 |
---|---|---|
committer | FChannel <> | 2021-07-31 16:35:42 -0700 |
commit | c2184d6add23d9b0ca44dbbc5d026ab4f482dceb (patch) | |
tree | ca2f8ef2557458eb045e3eafcccb5d7de823f41d /client.go | |
parent | 4a9452985a127a53572358c3b86a425a5df616e1 (diff) |
added pop route for removing archived posts. removed seeing archive page when not archived posts.
Diffstat (limited to 'client.go')
-rw-r--r-- | client.go | 20 |
1 files changed, 18 insertions, 2 deletions
@@ -206,6 +206,14 @@ func OutboxGet(w http.ResponseWriter, r *http.Request, db *sql.DB, collection Co "isOnion": func(url string) bool { return IsOnion(url) }, + "showArchive": func() bool { + col := GetActorCollectionDBTypeLimit(db, collection.Actor.Id, "Archive", 1) + + if len(col.OrderedItems) > 0 { + return true + } + return false; + }, "parseReplyLink": func(actorId string, op string, id string, content string) template.HTML { actor := FingerActor(actorId) title := strings.ReplaceAll(ParseLinkTitle(actor.Id, op, content), `/\<`, ">") @@ -282,6 +290,14 @@ func CatalogGet(w http.ResponseWriter, r *http.Request, db *sql.DB, collection C "isOnion": func(url string) bool { return IsOnion(url) }, + "showArchive": func() bool { + col := GetActorCollectionDBTypeLimit(db, collection.Actor.Id, "Archive", 1) + + if len(col.OrderedItems) > 0 { + return true + } + return false; + }, "sub": func (i, j int) int { return i - j }}).ParseFiles("./static/main.html", "./static/ncatalog.html", "./static/top.html")) actor := collection.Actor @@ -1008,7 +1024,7 @@ func ShortExcerpt(post ObjectBase) string { returnString = post.Content; } - re := regexp.MustCompile(`(^.{100})`) + re := regexp.MustCompile(`(^(.|\r\n|\n){100})`) match := re.FindStringSubmatch(returnString) @@ -1028,7 +1044,7 @@ func ShortExcerpt(post ObjectBase) string { } func IsOnion(url string) bool { - re := regexp.MustCompile(`\.onion$`) + re := regexp.MustCompile(`\.onion`) if(re.MatchString(url)) { return true; } |