aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go24
1 files changed, 24 insertions, 0 deletions
diff --git a/main.go b/main.go
index 5da910a..d43fab0 100644
--- a/main.go
+++ b/main.go
@@ -69,6 +69,8 @@ func main() {
FollowingBoards = GetActorFollowingDB(db, Domain)
+ StartupArchive(db)
+
Boards = GetBoardCollection(db)
// root actor is used to follow remote feeds that are not local
@@ -113,6 +115,7 @@ func main() {
var actorReported bool
var actorVerification bool
var actorMainPage bool
+ var actorArchive bool
var accept = r.Header.Get("Accept")
@@ -135,6 +138,7 @@ func main() {
actorFollowers = (path == "/" + actor.Name + "/followers")
actorReported = (path == "/" + actor.Name + "/reported")
actorVerification = (path == "/" + actor.Name + "/verification")
+ actorArchive = (path == "/" + actor.Name + "/archive")
escapedActorName := strings.Replace(actor.Name, "*", "\\*", -1)
escapedActorName = strings.Replace(escapedActorName, "^", "\\^", -1)
@@ -253,6 +257,14 @@ func main() {
return
}
+ if actorArchive {
+ collection, valid := WantToServeArchive(db, actor.Name)
+ if valid {
+ ArchiveGet(w, r, db, collection)
+ }
+ return
+ }
+
if actorReported {
GetActorReported(w, r, db, actor.Id)
return
@@ -843,6 +855,7 @@ func main() {
go DeleteObjectRequest(db, id)
}
+ UnArchiveLast(db)
if !isOP {
if (!IsIDLocal(db, id)){
@@ -890,6 +903,9 @@ func main() {
TombstoneObjectAndReplies(db, id)
}
+ UnArchiveLast(db)
+
+
if(manage == "t"){
http.Redirect(w, r, "/" + *Key + "/" + board , http.StatusSeeOther)
return
@@ -928,6 +944,8 @@ func main() {
go DeleteObjectRequest(db, id)
}
+ UnArchiveLast(db)
+
if(manage == "t"){
http.Redirect(w, r, "/" + *Key + "/" + board , http.StatusSeeOther)
return
@@ -2898,3 +2916,9 @@ func GetReplyOP(db *sql.DB, link string) string {
return id
}
+
+func StartupArchive(db *sql.DB) {
+ for _, e := range FollowingBoards {
+ ArchivePosts(db, GetActorFromDB(db, e.Id))
+ }
+}