mirror of
https://github.com/schollz/cowyo.git
synced 2023-08-10 21:13:00 +03:00
FIXES: 142 Make /raw work with self-destructing pages
This commit is contained in:
parent
9accd685c0
commit
55c07c6f87
@ -405,13 +405,15 @@ func (s *Site) handlePageRequest(c *gin.Context) {
|
|||||||
|
|
||||||
// Destroy page if it is opened and primed
|
// Destroy page if it is opened and primed
|
||||||
if p.IsPrimedForSelfDestruct && !isLocked && !p.IsEncrypted {
|
if p.IsPrimedForSelfDestruct && !isLocked && !p.IsEncrypted {
|
||||||
p.Update("<center><em>This page has self-destructed. You cannot return to it.</em></center>\n\n" + p.Text.GetCurrent())
|
if command != "/raw" {
|
||||||
p.Erase()
|
p.Update("<center><em>This page has self-destructed. You cannot return to it.</em></center>\n\n" + p.Text.GetCurrent())
|
||||||
if p.IsPublished {
|
if p.IsPublished {
|
||||||
command = "/read"
|
command = "/read"
|
||||||
} else {
|
} else {
|
||||||
command = "/view"
|
command = "/view"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
p.Erase()
|
||||||
}
|
}
|
||||||
if command == "/erase" {
|
if command == "/erase" {
|
||||||
if !isLocked && !p.IsEncrypted {
|
if !isLocked && !p.IsEncrypted {
|
||||||
|
Loading…
Reference in New Issue
Block a user