mirror of
https://github.com/chatmail/core.git
synced 2026-05-19 06:46:32 +03:00
feat: Execute sync message before checking for primary transport update
This way, if the sync message updates transports, the check for a new primary transport is done against the updated transport list which is more reliable.
This commit is contained in:
@@ -811,6 +811,10 @@ pub(crate) async fn receive_imf_inner(
|
|||||||
if let Some(ref sync_items) = mime_parser.sync_items {
|
if let Some(ref sync_items) = mime_parser.sync_items {
|
||||||
if from_id == ContactId::SELF {
|
if from_id == ContactId::SELF {
|
||||||
if mime_parser.was_encrypted() {
|
if mime_parser.was_encrypted() {
|
||||||
|
context
|
||||||
|
.execute_sync_items(sync_items, mime_parser.timestamp_sent)
|
||||||
|
.await;
|
||||||
|
|
||||||
// Receiving encrypted message from self updates primary transport.
|
// Receiving encrypted message from self updates primary transport.
|
||||||
let from_addr = &mime_parser.from.addr;
|
let from_addr = &mime_parser.from.addr;
|
||||||
|
|
||||||
@@ -845,10 +849,6 @@ pub(crate) async fn receive_imf_inner(
|
|||||||
info!(context, "Primary transport changed to {from_addr:?}.");
|
info!(context, "Primary transport changed to {from_addr:?}.");
|
||||||
context.sql.uncache_raw_config("configured_addr").await;
|
context.sql.uncache_raw_config("configured_addr").await;
|
||||||
}
|
}
|
||||||
|
|
||||||
context
|
|
||||||
.execute_sync_items(sync_items, mime_parser.timestamp_sent)
|
|
||||||
.await;
|
|
||||||
} else {
|
} else {
|
||||||
warn!(context, "Sync items are not encrypted.");
|
warn!(context, "Sync items are not encrypted.");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user