Add Event::ChatAutodeleteTimerModified

This commit is contained in:
Alexander Krotov
2020-01-04 20:41:48 +01:00
parent 0189644f08
commit f5ee9c530d
7 changed files with 69 additions and 1 deletions

View File

@@ -2,7 +2,7 @@ use chrono::TimeZone;
use lettre_email::{mime, Address, Header, MimeMultipartType, PartBuilder};
use crate::blob::BlobObject;
use crate::chat::{self, Chat};
use crate::chat::{self, get_autodelete_timer, Chat};
use crate::config::Config;
use crate::constants::*;
use crate::contact::*;
@@ -453,6 +453,14 @@ impl<'a, 'b> MimeFactory<'a, 'b> {
Loaded::MDN { .. } => dc_create_outgoing_rfc724_mid(None, &self.from_addr),
};
let autodelete_timer = get_autodelete_timer(self.context, self.msg.chat_id);
if autodelete_timer > 0 {
protected_headers.push(Header::new(
"Autodelete-Timer".to_string(),
autodelete_timer.to_string(),
));
}
// we could also store the message-id in the protected headers
// which would probably help to survive providers like
// Outlook.com or hotmail which mangle the Message-ID.