mirror of
https://github.com/jhillyerd/inbucket.git
synced 2025-12-17 17:47:03 +00:00
luahost: add type check TODOs (#436)
Signed-off-by: James Hillyerd <james@hillyerd.com>
This commit is contained in:
@@ -116,6 +116,7 @@ func inboundMessageNewIndex(ls *lua.LState) int {
|
|||||||
to := make([]mail.Address, 0, 16)
|
to := make([]mail.Address, 0, 16)
|
||||||
lt.ForEach(func(k, lv lua.LValue) {
|
lt.ForEach(func(k, lv lua.LValue) {
|
||||||
if ud, ok := lv.(*lua.LUserData); ok {
|
if ud, ok := lv.(*lua.LUserData); ok {
|
||||||
|
// TODO should fail if wrong type + test.
|
||||||
if entry, ok := unwrapMailAddress(ud); ok {
|
if entry, ok := unwrapMailAddress(ud); ok {
|
||||||
to = append(to, *entry)
|
to = append(to, *entry)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -99,6 +99,7 @@ func messageMetadataNewIndex(ls *lua.LState) int {
|
|||||||
to := make([]*mail.Address, 0, 16)
|
to := make([]*mail.Address, 0, 16)
|
||||||
lt.ForEach(func(k, lv lua.LValue) {
|
lt.ForEach(func(k, lv lua.LValue) {
|
||||||
if ud, ok := lv.(*lua.LUserData); ok {
|
if ud, ok := lv.(*lua.LUserData); ok {
|
||||||
|
// TODO should fail if wrong type + test.
|
||||||
if entry, ok := unwrapMailAddress(ud); ok {
|
if entry, ok := unwrapMailAddress(ud); ok {
|
||||||
to = append(to, entry)
|
to = append(to, entry)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user