1
0
mirror of https://github.com/jhillyerd/inbucket.git synced 2025-12-20 02:57:05 +00:00

Message list is now loaded by AJAX and can be refreshed.

Added a message delete button.
This commit is contained in:
James Hillyerd
2012-10-13 14:11:12 -07:00
parent 301c3efa63
commit a0ab84abb5
7 changed files with 137 additions and 50 deletions

View File

@@ -239,6 +239,15 @@ func (m *Message) Close() error {
return m.createGob()
}
// Delete this Message from disk by removing both the gob and raw files
func (m *Message) Delete() error {
err := os.Remove(m.gobPath())
if err != nil {
return err
}
return os.Remove(m.rawPath())
}
// createGob reads the .raw file to grab the From and Subject header entries,
// then creates the .gob file.
func (m *Message) createGob() error {