diff --git a/src/chat.rs b/src/chat.rs index 45d516e9a..bc695c647 100644 --- a/src/chat.rs +++ b/src/chat.rs @@ -1636,6 +1636,7 @@ pub async fn send_videochat_invitation(context: &Context, chat_id: ChatId) -> Re }; let mut msg = Message::new(Viewtype::VideochatInvitation); + msg.param.set(Param::VideochatUrl, &url); msg.text = Some( context .stock_string_repl_str(StockMessage::VideochatInviteMsgBody, url) diff --git a/src/mimefactory.rs b/src/mimefactory.rs index bac979fc4..822f3ab97 100644 --- a/src/mimefactory.rs +++ b/src/mimefactory.rs @@ -875,6 +875,19 @@ impl<'a, 'b> MimeFactory<'a, 'b> { if self.msg.viewtype == Viewtype::Sticker { protected_headers.push(Header::new("Chat-Content".into(), "sticker".into())); + } else if self.msg.viewtype == Viewtype::VideochatInvitation { + protected_headers.push(Header::new( + "Chat-Content".into(), + "videochat-invitation".into(), + )); + protected_headers.push(Header::new( + "Chat-Videochat-Url".into(), + self.msg + .param + .get(Param::VideochatUrl) + .unwrap_or_default() + .into(), + )); } if self.msg.viewtype == Viewtype::Voice diff --git a/src/param.rs b/src/param.rs index 77169f42c..8ccfd8bfc 100644 --- a/src/param.rs +++ b/src/param.rs @@ -68,6 +68,9 @@ pub enum Param { /// For Messages AttachGroupImage = b'A', + /// For Messages + VideochatUrl = b'V', + /// For Messages: space-separated list of messaged IDs of forwarded copies. /// /// This is used when a [crate::message::Message] is in the