Skip to content

Commit 43d3fda

Browse files
committed
feat: Don't send Chat-Group-Name* headers for InBroadcast-s
Broadcast subscribers can't change the chat name, so sending the "Chat-Group-Name{,-Timestamp}" headers looks unnecessary. That could be useful for other subscriber's devices, but having only the chat name isn't enough anyway, at least knowing the secret is necessary which is sent by the broadcast owner.
1 parent 3c25e4b commit 43d3fda

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

src/mimefactory.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1394,10 +1394,7 @@ impl MimeFactory {
13941394
}
13951395
}
13961396

1397-
if chat.typ == Chattype::Group
1398-
|| chat.typ == Chattype::OutBroadcast
1399-
|| chat.typ == Chattype::InBroadcast
1400-
{
1397+
if chat.typ == Chattype::Group || chat.typ == Chattype::OutBroadcast {
14011398
headers.push((
14021399
"Chat-Group-Name",
14031400
mail_builder::headers::text::Text::new(chat.name.to_string()).into(),
@@ -1408,7 +1405,11 @@ impl MimeFactory {
14081405
mail_builder::headers::text::Text::new(ts.to_string()).into(),
14091406
));
14101407
}
1411-
1408+
}
1409+
if chat.typ == Chattype::Group
1410+
|| chat.typ == Chattype::OutBroadcast
1411+
|| chat.typ == Chattype::InBroadcast
1412+
{
14121413
match command {
14131414
SystemMessage::MemberRemovedFromGroup => {
14141415
let email_to_remove = msg.param.get(Param::Arg).unwrap_or_default();

0 commit comments

Comments
 (0)