mirror of
https://github.com/chatmail/core.git
synced 2026-05-08 09:26:29 +03:00
this corrects the To:-list for group-messages with only SELF as member.
before, the list was empty and trying to send to groups that only contain SELF lead to a crash. in theory, this happens for both, bcc_self enabled or not, however, if bcc_self was disabled (default setting), things worked as the whole mimerendering was skipped on a higher level. also, the saved-messages-chat was not affected as this was checked explicitly. this pr changes the mimerendering so that From: is used as To: if there is no recipient-list and the messasge will be sent to SELF only.
This commit is contained in:
@@ -368,7 +368,7 @@ impl<'a, 'b> MimeFactory<'a, 'b> {
|
|||||||
self.from_addr.clone(),
|
self.from_addr.clone(),
|
||||||
);
|
);
|
||||||
|
|
||||||
let mut to = Vec::with_capacity(self.recipients.len());
|
let mut to = Vec::new();
|
||||||
for (name, addr) in self.recipients.iter() {
|
for (name, addr) in self.recipients.iter() {
|
||||||
if name.is_empty() {
|
if name.is_empty() {
|
||||||
to.push(Address::new_mailbox(addr.clone()));
|
to.push(Address::new_mailbox(addr.clone()));
|
||||||
@@ -380,6 +380,10 @@ impl<'a, 'b> MimeFactory<'a, 'b> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if to.is_empty() {
|
||||||
|
to.push(from.clone());
|
||||||
|
}
|
||||||
|
|
||||||
if !self.references.is_empty() {
|
if !self.references.is_empty() {
|
||||||
unprotected_headers.push(Header::new("References".into(), self.references.clone()));
|
unprotected_headers.push(Header::new("References".into(), self.references.clone()));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user