mirror of
https://github.com/chatmail/core.git
synced 2026-05-20 15:26:30 +03:00
Improve function documentation
This commit is contained in:
committed by
Floris Bruynooghe
parent
10689f45f4
commit
c0b1e41820
@@ -803,8 +803,19 @@ pub unsafe fn dc_create_outgoing_rfc724_mid(
|
|||||||
ret
|
ret
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Extract our group ID from Message-IDs as `Gr.12345678901.morerandom@domain.de`
|
/// Extract the group id (grpid) from a message id (mid)
|
||||||
/// `12345678901` is the wanted ID in this example.
|
///
|
||||||
|
/// # 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> {
|
pub fn dc_extract_grpid_from_rfc724_mid(mid: &str) -> Option<&str> {
|
||||||
if mid.len() < 9 || !mid.starts_with("Gr.") {
|
if mid.len() < 9 || !mid.starts_with("Gr.") {
|
||||||
return None;
|
return None;
|
||||||
|
|||||||
Reference in New Issue
Block a user