mirror of
https://github.com/chatmail/core.git
synced 2026-05-07 17:06:35 +03:00
correct summary for videochat-invites
This commit is contained in:
@@ -1374,11 +1374,12 @@ pub(crate) fn msgtype_has_file(msgtype: Viewtype) -> bool {
|
|||||||
Viewtype::Voice => true,
|
Viewtype::Voice => true,
|
||||||
Viewtype::Video => true,
|
Viewtype::Video => true,
|
||||||
Viewtype::File => true,
|
Viewtype::File => true,
|
||||||
|
Viewtype::VideochatInvitation => false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn prepare_msg_blob(context: &Context, msg: &mut Message) -> Result<(), Error> {
|
async fn prepare_msg_blob(context: &Context, msg: &mut Message) -> Result<(), Error> {
|
||||||
if msg.viewtype == Viewtype::Text {
|
if msg.viewtype == Viewtype::Text || msg.viewtype == Viewtype::VideochatInvitation {
|
||||||
// the caller should check if the message text is empty
|
// the caller should check if the message text is empty
|
||||||
} else if msgtype_has_file(msg.viewtype) {
|
} else if msgtype_has_file(msg.viewtype) {
|
||||||
let blob = msg
|
let blob = msg
|
||||||
@@ -1634,7 +1635,7 @@ pub async fn send_videochat_invitation(context: &Context, chat_id: ChatId) -> Re
|
|||||||
format!("{}{}", url, room)
|
format!("{}{}", url, room)
|
||||||
};
|
};
|
||||||
|
|
||||||
let mut msg = Message::new(Viewtype::Text);
|
let mut msg = Message::new(Viewtype::VideochatInvitation);
|
||||||
msg.text = Some(
|
msg.text = Some(
|
||||||
context
|
context
|
||||||
.stock_string_repl_str(StockMessage::VideochatInviteMsgBody, url)
|
.stock_string_repl_str(StockMessage::VideochatInviteMsgBody, url)
|
||||||
|
|||||||
@@ -296,6 +296,9 @@ pub enum Viewtype {
|
|||||||
/// The file is set via dc_msg_set_file()
|
/// The file is set via dc_msg_set_file()
|
||||||
/// and retrieved via dc_msg_get_file().
|
/// and retrieved via dc_msg_get_file().
|
||||||
File = 60,
|
File = 60,
|
||||||
|
|
||||||
|
/// Message is an invitation to a videochat.
|
||||||
|
VideochatInvitation = 70,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for Viewtype {
|
impl Default for Viewtype {
|
||||||
|
|||||||
@@ -1249,6 +1249,13 @@ pub async fn get_summarytext_by_raw(
|
|||||||
format!("{} – {}", label, file_name)
|
format!("{} – {}", label, file_name)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Viewtype::VideochatInvitation => {
|
||||||
|
append_text = false;
|
||||||
|
context
|
||||||
|
.stock_str(StockMessage::VideochatInvitation)
|
||||||
|
.await
|
||||||
|
.into_owned()
|
||||||
|
}
|
||||||
_ => {
|
_ => {
|
||||||
if param.get_cmd() != SystemMessage::LocationOnly {
|
if param.get_cmd() != SystemMessage::LocationOnly {
|
||||||
"".to_string()
|
"".to_string()
|
||||||
|
|||||||
Reference in New Issue
Block a user