mirror of
https://github.com/chatmail/core.git
synced 2026-04-22 16:06:30 +03:00
fix: Fetch existing messages for bots as InFresh (#4976)
Before, if `Config::FetchExistingMsgs` is set, existing messages were received with the `InSeen` state set, but for bots they must be `InFresh` and also `IncomingMsg` events should be emitted for them so that they are processed by bots as it happens with new messages.
This commit is contained in:
@@ -696,6 +696,9 @@ async fn add_parts(
|
||||
prevent_rename: bool,
|
||||
verified_encryption: VerifiedEncryption,
|
||||
) -> Result<ReceivedMsg> {
|
||||
let is_bot = context.get_config_bool(Config::Bot).await?;
|
||||
// Bots handle existing messages the same way as new ones.
|
||||
let fetching_existing_messages = fetching_existing_messages && !is_bot;
|
||||
let rfc724_mid_orig = &mime_parser
|
||||
.get_rfc724_mid()
|
||||
.unwrap_or(rfc724_mid.to_string());
|
||||
@@ -788,9 +791,6 @@ async fn add_parts(
|
||||
info!(context, "Message is an MDN (TRASH).",);
|
||||
}
|
||||
|
||||
// signals whether the current user is a bot
|
||||
let is_bot = context.get_config_bool(Config::Bot).await?;
|
||||
|
||||
let create_blocked_default = if is_bot {
|
||||
Blocked::Not
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user