Store typed timer in ChatEphemeralTimerModified event

This commit is contained in:
Alexander Krotov
2020-07-10 02:55:17 +03:00
parent e5d5009d6a
commit f28a0db7d0
3 changed files with 7 additions and 3 deletions

View File

@@ -179,7 +179,7 @@ impl ChatId {
context.emit_event(Event::ChatEphemeralTimerModified {
chat_id: self,
timer: timer.to_u32(),
timer,
});
Ok(())
}

View File

@@ -5,6 +5,7 @@ use async_std::sync::{channel, Receiver, Sender, TrySendError};
use strum::EnumProperty;
use crate::chat::ChatId;
use crate::ephemeral::Timer as EphemeralTimer;
use crate::message::MsgId;
#[derive(Debug)]
@@ -197,7 +198,10 @@ pub enum Event {
/// Chat ephemeral timer changed.
#[strum(props(id = "2021"))]
ChatEphemeralTimerModified { chat_id: ChatId, timer: u32 },
ChatEphemeralTimerModified {
chat_id: ChatId,
timer: EphemeralTimer,
},
/// Contact(s) created, renamed, blocked or deleted.
///