mirror of
https://github.com/chatmail/core.git
synced 2026-04-28 10:56:29 +03:00
Save subject for messages 2: Outgoing messages (#2283)
* Save subject for sent-out messages * Test that subject is saved (outgoing) * Correctly set subject when forwarding messages, add test for this
This commit is contained in:
@@ -22,6 +22,7 @@ use crate::dc_tools::{
|
||||
use crate::ephemeral::Timer as EphemeralTimer;
|
||||
use crate::events::EventType;
|
||||
use crate::job::{self, Action};
|
||||
use crate::log::LogExt;
|
||||
use crate::lot::{Lot, LotState, Meaning};
|
||||
use crate::mimeparser::{FailureReport, SystemMessage};
|
||||
use crate::param::{Param, Params};
|
||||
@@ -307,7 +308,6 @@ pub struct Message {
|
||||
pub(crate) ephemeral_timer: EphemeralTimer,
|
||||
pub(crate) ephemeral_timestamp: i64,
|
||||
pub(crate) text: Option<String>,
|
||||
/// The value of the Subject header. Not set for messages that we sent ourselves.
|
||||
pub(crate) subject: String,
|
||||
pub(crate) rfc724_mid: String,
|
||||
pub(crate) in_reply_to: Option<String>,
|
||||
@@ -912,7 +912,7 @@ impl Message {
|
||||
Ok(None)
|
||||
}
|
||||
|
||||
pub async fn update_param(&mut self, context: &Context) -> bool {
|
||||
pub async fn update_param(&self, context: &Context) {
|
||||
context
|
||||
.sql
|
||||
.execute(
|
||||
@@ -920,7 +920,18 @@ impl Message {
|
||||
paramsv![self.param.to_string(), self.id],
|
||||
)
|
||||
.await
|
||||
.is_ok()
|
||||
.ok_or_log(context);
|
||||
}
|
||||
|
||||
pub(crate) async fn update_subject(&self, context: &Context) {
|
||||
context
|
||||
.sql
|
||||
.execute(
|
||||
"UPDATE msgs SET subject=? WHERE id=?;",
|
||||
paramsv![self.subject, self.id],
|
||||
)
|
||||
.await
|
||||
.ok_or_log(context);
|
||||
}
|
||||
|
||||
/// Gets the error status of the message.
|
||||
|
||||
Reference in New Issue
Block a user