rename w30 to webxdc

This commit is contained in:
B. Petersen
2022-01-01 15:30:16 +01:00
committed by bjoern
parent 7ff25f282e
commit 8e8c10c438
20 changed files with 222 additions and 220 deletions

View File

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