mirror of
https://github.com/chatmail/core.git
synced 2026-05-03 05:16:28 +03:00
fix: Assign encrypted partially downloaded group messages to 1:1 chat (#4757)
Before they were trashed. Note that for unencrypted ones DC works as expected creating the requested group immediately because Chat-Group-Id is duplicated in the Message-Id header and Subject is fetched.
This commit is contained in:
@@ -596,6 +596,7 @@ async fn add_parts(
|
||||
if let Some((new_chat_id, new_chat_id_blocked)) = create_or_lookup_group(
|
||||
context,
|
||||
mime_parser,
|
||||
is_partial_download.is_some(),
|
||||
if test_normal_chat.is_none() {
|
||||
allow_creation
|
||||
} else {
|
||||
@@ -822,6 +823,7 @@ async fn add_parts(
|
||||
if let Some((new_chat_id, new_chat_id_blocked)) = create_or_lookup_group(
|
||||
context,
|
||||
mime_parser,
|
||||
is_partial_download.is_some(),
|
||||
allow_creation,
|
||||
Blocked::Not,
|
||||
from_id,
|
||||
@@ -1518,6 +1520,7 @@ async fn is_probably_private_reply(
|
||||
async fn create_or_lookup_group(
|
||||
context: &Context,
|
||||
mime_parser: &mut MimeMessage,
|
||||
is_partial_download: bool,
|
||||
allow_creation: bool,
|
||||
create_blocked: Blocked,
|
||||
from_id: ContactId,
|
||||
@@ -1648,7 +1651,7 @@ async fn create_or_lookup_group(
|
||||
|
||||
if let Some(chat_id) = chat_id {
|
||||
Ok(Some((chat_id, chat_id_blocked)))
|
||||
} else if mime_parser.decrypting_failed {
|
||||
} else if is_partial_download || mime_parser.decrypting_failed {
|
||||
// It is possible that the message was sent to a valid,
|
||||
// yet unknown group, which was rejected because
|
||||
// Chat-Group-Name, which is in the encrypted part, was
|
||||
|
||||
Reference in New Issue
Block a user