mirror of
https://github.com/chatmail/core.git
synced 2026-05-02 21:06:31 +03:00
simplify code-path
This commit is contained in:
@@ -712,20 +712,6 @@ async fn add_parts(
|
|||||||
// hour, only the message about the change to 1
|
// hour, only the message about the change to 1
|
||||||
// week is left.
|
// week is left.
|
||||||
ephemeral_timer = EphemeralTimer::Disabled;
|
ephemeral_timer = EphemeralTimer::Disabled;
|
||||||
} else if mime_parser.is_system_message == SystemMessage::ChatProtectionEnabled {
|
|
||||||
set_better_msg(
|
|
||||||
mime_parser,
|
|
||||||
chat_id
|
|
||||||
.get_protection_msg(context, ProtectionStatus::Protected, from_id)
|
|
||||||
.await,
|
|
||||||
);
|
|
||||||
} else if mime_parser.is_system_message == SystemMessage::ChatProtectionDisabled {
|
|
||||||
set_better_msg(
|
|
||||||
mime_parser,
|
|
||||||
chat_id
|
|
||||||
.get_protection_msg(context, ProtectionStatus::Unprotected, from_id)
|
|
||||||
.await,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// change chat protection
|
// change chat protection
|
||||||
@@ -733,10 +719,22 @@ async fn add_parts(
|
|||||||
chat_id
|
chat_id
|
||||||
.inner_set_protection(context, ProtectionStatus::Protected)
|
.inner_set_protection(context, ProtectionStatus::Protected)
|
||||||
.await?;
|
.await?;
|
||||||
|
set_better_msg(
|
||||||
|
mime_parser,
|
||||||
|
chat_id
|
||||||
|
.get_protection_msg(context, ProtectionStatus::Protected, from_id)
|
||||||
|
.await,
|
||||||
|
);
|
||||||
} else if mime_parser.is_system_message == SystemMessage::ChatProtectionDisabled {
|
} else if mime_parser.is_system_message == SystemMessage::ChatProtectionDisabled {
|
||||||
chat_id
|
chat_id
|
||||||
.inner_set_protection(context, ProtectionStatus::Unprotected)
|
.inner_set_protection(context, ProtectionStatus::Unprotected)
|
||||||
.await?;
|
.await?;
|
||||||
|
set_better_msg(
|
||||||
|
mime_parser,
|
||||||
|
chat_id
|
||||||
|
.get_protection_msg(context, ProtectionStatus::Unprotected, from_id)
|
||||||
|
.await,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// correct message_timestamp, it should not be used before,
|
// correct message_timestamp, it should not be used before,
|
||||||
|
|||||||
Reference in New Issue
Block a user