Make ephemeral timer changes not ephemeral

This commit is contained in:
Alexander Krotov
2020-07-08 00:43:49 +03:00
committed by link2xt
parent 43c4816739
commit 7f8f871813
3 changed files with 17 additions and 3 deletions

View File

@@ -959,7 +959,11 @@ impl Chat {
.await?;
}
let ephemeral_timer = self.id.get_ephemeral_timer(context).await?;
let ephemeral_timer = if msg.param.get_cmd() == SystemMessage::EphemeralTimerChanged {
EphemeralTimer::Disabled
} else {
self.id.get_ephemeral_timer(context).await?
};
let ephemeral_timestamp = match ephemeral_timer {
EphemeralTimer::Disabled => 0,
EphemeralTimer::Enabled { duration } => timestamp + i64::from(duration),