1
0
mirror of https://github.com/schollz/cowyo.git synced 2023-08-10 21:13:00 +03:00

Self destruct with published messages works

This commit is contained in:
Zack Scholl 2018-02-18 11:33:32 -08:00
parent 3c53386e08
commit 1720711029

View File

@ -297,7 +297,11 @@ func handlePageRequest(c *gin.Context) {
if p.IsPrimedForSelfDestruct && !p.IsLocked && !p.IsEncrypted { if p.IsPrimedForSelfDestruct && !p.IsLocked && !p.IsEncrypted {
p.Update("*This page has self-destructed. You can not return to it.*\n\n" + p.Text.GetCurrent()) p.Update("*This page has self-destructed. You can not return to it.*\n\n" + p.Text.GetCurrent())
p.Erase() p.Erase()
command = "/view" if p.IsPublished {
command = "/read"
} else {
command = "/view"
}
} }
if command == "/erase" { if command == "/erase" {
if !p.IsLocked && !p.IsEncrypted { if !p.IsLocked && !p.IsEncrypted {