diff --git a/src/dc_tools.rs b/src/dc_tools.rs index 8f829aee1..40f78c75e 100644 --- a/src/dc_tools.rs +++ b/src/dc_tools.rs @@ -803,8 +803,19 @@ pub unsafe fn dc_create_outgoing_rfc724_mid( ret } -/// Extract our group ID from Message-IDs as `Gr.12345678901.morerandom@domain.de` -/// `12345678901` is the wanted ID in this example. +/// Extract the group id (grpid) from a message id (mid) +/// +/// # Arguments +/// +/// * `mid` - A string that holds the message id +/// +/// # Examples +/// +/// ``` +/// let mid = "Gr.12345678901.morerandom@domain.de"; +/// let grpid = dc_extract_grpid_from_rfc724_mid(mid); +/// assert_eq!(grpid, Some("12345678901")); +/// ``` pub fn dc_extract_grpid_from_rfc724_mid(mid: &str) -> Option<&str> { if mid.len() < 9 || !mid.starts_with("Gr.") { return None;