mirror of
https://github.com/chatmail/core.git
synced 2026-04-24 17:06:28 +03:00
Generate rfc724_mid when creating Message (#6704)
Set `rfc724_mid` in `Message::new()`, `Message::new_text()`, and `Message::default()` instead of when sending the message. This way the rfc724 mid can be read in the draft stage which makes it more consistent for bots. Tests had to be adjusted to create multiple messages to get unique mid, otherwise core would not send the messages out.
This commit is contained in:
@@ -33,6 +33,7 @@ use crate::reaction::get_msg_reactions;
|
||||
use crate::sql;
|
||||
use crate::summary::Summary;
|
||||
use crate::sync::SyncData;
|
||||
use crate::tools::create_outgoing_rfc724_mid;
|
||||
use crate::tools::{
|
||||
buf_compress, buf_decompress, get_filebytes, get_filemeta, gm2local_offset, read_file,
|
||||
sanitize_filename, time, timestamp_to_str,
|
||||
@@ -470,6 +471,7 @@ impl Message {
|
||||
pub fn new(viewtype: Viewtype) -> Self {
|
||||
Message {
|
||||
viewtype,
|
||||
rfc724_mid: create_outgoing_rfc724_mid(),
|
||||
..Default::default()
|
||||
}
|
||||
}
|
||||
@@ -479,6 +481,7 @@ impl Message {
|
||||
Message {
|
||||
viewtype: Viewtype::Text,
|
||||
text,
|
||||
rfc724_mid: create_outgoing_rfc724_mid(),
|
||||
..Default::default()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user