mirror of
https://github.com/mailscope/kumomta.git
synced 2026-09-10 12:32:13 +00:00
kumo.make_message: accepts bytes and not just utf8
Sometimes you have non-utf8 data that you want to load in
This commit is contained in:
@@ -208,13 +208,13 @@ pub fn register(lua: &Lua) -> anyhow::Result<()> {
|
||||
kumo_mod.set(
|
||||
"make_message",
|
||||
lua.create_function(
|
||||
move |_lua, (sender, recip, body): (String, String, String)| {
|
||||
move |_lua, (sender, recip, body): (String, String, mlua::String)| {
|
||||
Message::new_dirty(
|
||||
SpoolId::new(),
|
||||
EnvelopeAddress::parse(&sender).map_err(any_err)?,
|
||||
EnvelopeAddress::parse(&recip).map_err(any_err)?,
|
||||
serde_json::json!({}),
|
||||
Arc::new(body.into_bytes().into_boxed_slice()),
|
||||
Arc::new(body.as_bytes().to_vec().into_boxed_slice()),
|
||||
)
|
||||
.map_err(any_err)
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user