CommonMessage -> Common, PinnedMessage -> Pinned

This commit is contained in:
Temirkhan Myrzamadi 2019-09-21 02:05:56 +06:00
parent 84548b0727
commit 2b23136e2f

View file

@ -16,7 +16,7 @@ pub struct Message {
impl Message { impl Message {
fn text(&self) -> Option<&str> { fn text(&self) -> Option<&str> {
if let MessageKind::CommonMessage { if let MessageKind::Common {
media_kind: MediaKind::Text { media_kind: MediaKind::Text {
ref text, .. ref text, ..
}, .. } = self.kind { }, .. } = self.kind {
@ -30,7 +30,7 @@ impl Message {
#[derive(Debug, Deserialize, PartialEq, Clone)] #[derive(Debug, Deserialize, PartialEq, Clone)]
#[serde(untagged)] #[serde(untagged)]
pub enum MessageKind { pub enum MessageKind {
CommonMessage { Common {
#[serde(flatten)] #[serde(flatten)]
from: Sender, from: Sender,
#[serde(flatten)] #[serde(flatten)]
@ -68,8 +68,8 @@ pub enum MessageKind {
migrate_to_chat_id: i64, migrate_to_chat_id: i64,
migrate_from_chat_id: i64, migrate_from_chat_id: i64,
}, },
PinnedMessage { Pinned {
pinned_message: Box<Message>, pinned: Box<Message>,
}, },
Invoice { Invoice {
invoice: Invoice, invoice: Invoice,