aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/routes.go
diff options
context:
space:
mode:
authorGusted <williamzijl7@hotmail.com>2021-08-04 03:20:45 +0200
committerSimon Ser <contact@emersion.fr>2021-08-04 11:01:05 +0200
commit5265ac59b1c8f40ced2294be72a41746b5a8a041 (patch)
tree8906fe71185b37c2f1f78df6ab04da64b3294bea /plugins/base/routes.go
parent5d290410ee22092535533a1ba10ee7ad288342e2 (diff)
downloadalps-5265ac59b1c8f40ced2294be72a41746b5a8a041.tar.gz
alps-5265ac59b1c8f40ced2294be72a41746b5a8a041.zip
Simplify
Diffstat (limited to 'plugins/base/routes.go')
-rw-r--r--plugins/base/routes.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/plugins/base/routes.go b/plugins/base/routes.go
index 321303d..f426c96 100644
--- a/plugins/base/routes.go
+++ b/plugins/base/routes.go
@@ -181,7 +181,7 @@ func newIMAPBaseRenderData(ctx *alps.Context,
var categorized CategorizedMailboxes
- for i, _ := range mailboxes {
+ for i := range mailboxes {
// Populate unseen & active states
if active != nil && mailboxes[i].Name == active.Name {
mailboxes[i].Unseen = int(active.Unseen)
@@ -403,6 +403,9 @@ type MessageRenderData struct {
func handleGetPart(ctx *alps.Context, raw bool) error {
_, uid, err := parseMboxAndUid(ctx.Param("mbox"), ctx.Param("uid"))
+ if err != nil {
+ return err
+ }
ibase, err := newIMAPBaseRenderData(ctx, alps.NewBaseRenderData(ctx))
if err != nil {
return err
@@ -468,9 +471,8 @@ func handleGetPart(ctx *alps.Context, raw bool) error {
if len(partPath) == 0 {
return part.WriteTo(ctx.Response())
- } else {
- return ctx.Stream(http.StatusOK, mimeType, part.Body)
}
+ return ctx.Stream(http.StatusOK, mimeType, part.Body)
}
view, err := viewMessagePart(ctx, msg, part)