Do not duplicate system messages about timer changes

Instead, replace them with localized stock strings using set_better_msg.
This commit is contained in:
Alexander Krotov
2020-07-02 12:46:27 +03:00
committed by link2xt
parent 6050f0e2a1
commit d9314227ee

View File

@@ -653,12 +653,20 @@ async fn add_parts(
{
match (*chat_id).inner_set_ephemeral_timer(context, timer).await {
Ok(()) => {
chat::add_info_msg(
context,
*chat_id,
stock_ephemeral_timer_changed(context, timer, from_id).await,
)
.await;
if mime_parser.is_system_message == SystemMessage::EphemeralTimerChanged {
set_better_msg(
mime_parser,
stock_ephemeral_timer_changed(context, timer, from_id).await,
);
} else {
chat::add_info_msg(
context,
*chat_id,
stock_ephemeral_timer_changed(context, timer, from_id).await,
)
.await;
}
context.emit_event(Event::ChatEphemeralTimerModified {
chat_id: *chat_id,
timer: timer.to_u32(),