mirror of
https://github.com/chatmail/core.git
synced 2026-04-21 07:26:29 +03:00
refactor: add MimeMessage.get_chat_group_id()
This commit is contained in:
@@ -36,6 +36,7 @@ use crate::simplify::{simplify, SimplifiedText};
|
||||
use crate::sync::SyncItems;
|
||||
use crate::tools::{
|
||||
create_smeared_timestamp, get_filemeta, parse_receive_headers, smeared_time, truncate_by_lines,
|
||||
validate_id,
|
||||
};
|
||||
use crate::{chatlist_events, location, stock_str, tools};
|
||||
|
||||
@@ -818,6 +819,12 @@ impl MimeMessage {
|
||||
self.headers.get(headerdef.get_headername())
|
||||
}
|
||||
|
||||
/// Returns `Chat-Group-ID` header value if it is a valid group ID.
|
||||
pub fn get_chat_group_id(&self) -> Option<&String> {
|
||||
self.get_header(HeaderDef::ChatGroupId)
|
||||
.filter(|s| validate_id(s))
|
||||
}
|
||||
|
||||
async fn parse_mime_recursive<'a>(
|
||||
&'a mut self,
|
||||
context: &'a Context,
|
||||
|
||||
Reference in New Issue
Block a user