send videochat-url and -invitation also through header

This commit is contained in:
B. Petersen
2020-07-20 16:27:04 +02:00
parent f39abd6d51
commit b9d3e6b342
3 changed files with 17 additions and 0 deletions

View File

@@ -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)

View File

@@ -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

View File

@@ -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