mirror of
https://github.com/chatmail/core.git
synced 2026-04-24 17:06:28 +03:00
rename w30 to webxdc
This commit is contained in:
16
src/chat.rs
16
src/chat.rs
@@ -37,7 +37,7 @@ use crate::mimeparser::SystemMessage;
|
||||
use crate::param::{Param, Params};
|
||||
use crate::peerstate::{Peerstate, PeerstateVerifiedStatus};
|
||||
use crate::stock_str;
|
||||
use crate::w30::W30_SUFFIX;
|
||||
use crate::webxdc::WEBXDC_SUFFIX;
|
||||
|
||||
/// An chat item, such as a message or a marker.
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
@@ -646,8 +646,8 @@ impl ChatId {
|
||||
.await?
|
||||
.context("no file stored in params")?;
|
||||
msg.param.set(Param::File, blob.as_name());
|
||||
if blob.suffix() == Some(W30_SUFFIX) {
|
||||
msg.viewtype = Viewtype::W30;
|
||||
if blob.suffix() == Some(WEBXDC_SUFFIX) {
|
||||
msg.viewtype = Viewtype::Webxdc;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1800,7 +1800,7 @@ pub(crate) fn msgtype_has_file(msgtype: Viewtype) -> bool {
|
||||
Viewtype::Video => true,
|
||||
Viewtype::File => true,
|
||||
Viewtype::VideochatInvitation => false,
|
||||
Viewtype::W30 => true,
|
||||
Viewtype::Webxdc => true,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1842,8 +1842,12 @@ async fn prepare_msg_blob(context: &Context, msg: &mut Message) -> Result<()> {
|
||||
}
|
||||
}
|
||||
|
||||
if msg.viewtype == Viewtype::W30 && blob.suffix() != Some(W30_SUFFIX) {
|
||||
bail!("w30 message {} does not have suffix {}", blob, W30_SUFFIX);
|
||||
if msg.viewtype == Viewtype::Webxdc && blob.suffix() != Some(WEBXDC_SUFFIX) {
|
||||
bail!(
|
||||
"webxdc message {} does not have suffix {}",
|
||||
blob,
|
||||
WEBXDC_SUFFIX
|
||||
);
|
||||
}
|
||||
|
||||
info!(
|
||||
|
||||
Reference in New Issue
Block a user