Notify a removed member that they were removed

This commit is contained in:
Hocuri
2025-08-08 15:00:32 +02:00
parent 378896eca3
commit 0acc34a882
6 changed files with 83 additions and 41 deletions

View File

@@ -1433,6 +1433,7 @@ impl MimeFactory {
match command {
SystemMessage::MemberRemovedFromGroup => {
let email_to_remove = msg.param.get(Param::Arg).unwrap_or_default();
let fingerprint_to_remove = msg.param.get(Param::Arg2).unwrap_or_default();
if email_to_remove
== context
@@ -1453,6 +1454,14 @@ impl MimeFactory {
.into(),
));
}
if !fingerprint_to_remove.is_empty() {
headers.push((
"Chat-Group-Member-Removed-Fpr",
mail_builder::headers::raw::Raw::new(fingerprint_to_remove.to_string())
.into(),
));
}
}
SystemMessage::MemberAddedToGroup => {
// TODO: lookup the contact by ID rather than email address.