aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/routes.go
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2020-11-19 11:17:40 -0500
committerDrew DeVault <sir@cmpwn.com>2020-11-19 11:17:40 -0500
commitcb37df882edc51ed47f4b353ce42eabd80416b19 (patch)
tree42b060f231d5d976626f6a04b9e3160f974066f0 /plugins/base/routes.go
parent405c18d21388f1cc6f8b7349186efb3fa44eef87 (diff)
downloadalps-cb37df882edc51ed47f4b353ce42eabd80416b19.tar.gz
alps-cb37df882edc51ed47f4b353ce42eabd80416b19.zip
Add notices on action completion
Diffstat (limited to 'plugins/base/routes.go')
-rw-r--r--plugins/base/routes.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/plugins/base/routes.go b/plugins/base/routes.go
index 0345189..1562a15 100644
--- a/plugins/base/routes.go
+++ b/plugins/base/routes.go
@@ -306,6 +306,7 @@ func handleDeleteMailbox(ctx *alps.Context) error {
ctx.Session.DoIMAP(func(c *imapclient.Client) error {
return c.Delete(mbox.Name)
})
+ ctx.Session.PutNotice("Mailbox deleted.")
return ctx.Redirect(http.StatusFound, "/mailbox/INBOX")
}
@@ -519,6 +520,7 @@ func submitCompose(ctx *alps.Context, msg *OutgoingMessage, options *composeOpti
return fmt.Errorf("failed to save message to Sent mailbox: %v", err)
}
+ ctx.Session.PutNotice("Message sent.")
return ctx.Redirect(http.StatusFound, "/mailbox/INBOX")
}
@@ -651,6 +653,7 @@ func handleCompose(ctx *alps.Context, msg *OutgoingMessage, options *composeOpti
if err != nil {
return fmt.Errorf("failed to save message to Draft mailbox: %v", err)
}
+ ctx.Session.PutNotice("Message saved as draft.")
return ctx.Redirect(http.StatusFound, fmt.Sprintf(
"/message/%s/%d/edit?part=1", drafts.Name, uid))
} else {
@@ -981,6 +984,7 @@ func handleMove(ctx *alps.Context) error {
return err
}
+ ctx.Session.PutNotice("Message(s) moved.")
if path := formOrQueryParam(ctx, "next"); path != "" {
return ctx.Redirect(http.StatusFound, path)
}
@@ -1032,6 +1036,7 @@ func handleDelete(ctx *alps.Context) error {
return err
}
+ ctx.Session.PutNotice("Message(s) deleted.")
if path := formOrQueryParam(ctx, "next"); path != "" {
return ctx.Redirect(http.StatusFound, path)
}