瀏覽代碼

Add basic support for multiple recipients

master
Simon Ser 4 年之前
父節點
當前提交
e90d4579ae
沒有發現已知的金鑰在資料庫的簽署中 GPG Key ID: FDE7BE0E88F5E48
共有 2 個文件被更改,包括 10 次插入3 次删除
  1. +2
    -3
      server.go
  2. +8
    -0
      strconv.go

+ 2
- 3
server.go 查看文件

@@ -271,9 +271,8 @@ func handleCompose(ectx echo.Context) error {
}

if ctx.Request().Method == http.MethodPost {
// TODO: parse address lists
from := ctx.FormValue("from")
to := ctx.FormValue("to")
to := parseAddressList(ctx.FormValue("to"))
subject := ctx.FormValue("subject")
text := ctx.FormValue("text")

@@ -289,7 +288,7 @@ func handleCompose(ectx echo.Context) error {
}

msg.From = from
msg.To = []string{to}
msg.To = to
msg.Subject = subject
msg.Text = text



+ 8
- 0
strconv.go 查看文件

@@ -47,3 +47,11 @@ func parsePartPath(s string) ([]int, error) {
}
return path, nil
}

func parseAddressList(s string) []string {
l := strings.Split(s, ",")
for i, addr := range l {
l[i] = strings.TrimSpace(addr)
}
return l
}

Loading…
取消
儲存