diff --git a/deltachat-ffi/deltachat.h b/deltachat-ffi/deltachat.h
index 7b89adf2c..3fc5c130c 100644
--- a/deltachat-ffi/deltachat.h
+++ b/deltachat-ffi/deltachat.h
@@ -983,39 +983,39 @@ uint32_t dc_send_videochat_invitation (dc_context_t* context, uint32_t chat_id);
/**
- * An w30 instance send a status update to its other members.
+ * An webxdc instance send a status update to its other members.
*
* In js-land, that would be mapped to sth. as:
* ```
* success = window.webxdc.sendUpdate('move A3 B4', '{"action":"move","src":"A3","dest":"B4"}');
* ```
- * `context` and `msg_id` is not needed in js as that is unique within an w30 instance.
- * See dc_get_w30_status_updates() for the receiving counterpart.
+ * `context` and `msg_id` is not needed in js as that is unique within an webxdc instance.
+ * See dc_get_webxdc_status_updates() for the receiving counterpart.
*
- * If the w30 instance is a draft, the update is not send immediately.
+ * If the webxdc instance is a draft, the update is not send immediately.
* Instead, the updates are collected and sent out in batch when the instance is actually sent.
- * This allows preparing w30 instances,
+ * This allows preparing webxdc instances,
* eg. defining a poll with predefined answers.
*
- * Other members will be informed by #DC_EVENT_W30_STATUS_UPDATE that there is a new update.
- * You will also get the #DC_EVENT_W30_STATUS_UPDATE yourself
- * and the update you're sent will also be included in dc_get_w30_status_updates().
+ * Other members will be informed by #DC_EVENT_WEBXDC_STATUS_UPDATE that there is a new update.
+ * You will also get the #DC_EVENT_WEBXDC_STATUS_UPDATE yourself
+ * and the update you're sent will also be included in dc_get_webxdc_status_updates().
*
* @memberof dc_context_t
* @param context The context object
- * @param msg_id id of the message with the w30 instance
+ * @param msg_id id of the message with the webxdc instance
* @param descr user-visible description of the json-data,
* in case of a chess game, eg. the move.
* @param json program-readable data, the actual payload
* @return 1=success, 0=error
*/
-int dc_send_w30_status_update (dc_context_t* context, uint32_t msg_id, const char* descr, const char* json);
+int dc_send_webxdc_status_update (dc_context_t* context, uint32_t msg_id, const char* descr, const char* json);
/**
* Get status updates.
- * The status updates may be sent by yourself or by other members using dc_send_w30_status_update().
- * In both cases, you will be informed by #DC_EVENT_W30_STATUS_UPDATE
+ * The status updates may be sent by yourself or by other members using dc_send_webxdc_status_update().
+ * In both cases, you will be informed by #DC_EVENT_WEBXDC_STATUS_UPDATE
* whenever there is a new update.
*
* In js-land, that would be mapped to sth. as:
@@ -1030,15 +1030,15 @@ int dc_send_w30_status_update (dc_context_t* context, uint32_t msg_id, const cha
*
* @memberof dc_context_t
* @param context The context object
- * @param msg_id id of the message with the w30 instance
+ * @param msg_id id of the message with the webxdc instance
* @param status_update_id Can be used to filter out only a concrete status update.
* When set to 0, all known status updates are returned.
* @return JSON-array containing the requested updates,
- * each element was created by dc_send_w30_status_update()
+ * each element was created by dc_send_webxdc_status_update()
* on this or other devices.
* If there are no updates, an empty JSON-array is returned.
*/
-char* dc_get_w30_status_updates (dc_context_t* context, uint32_t msg_id, uint32_t status_update_id);
+char* dc_get_webxdc_status_updates (dc_context_t* context, uint32_t msg_id, uint32_t status_update_id);
/**
* Save a draft for a chat in the database.
@@ -3676,17 +3676,17 @@ char* dc_msg_get_filemime (const dc_msg_t* msg);
/**
- * Return file from inside an archive.
- * Currently, this works for W30 messages only.
+ * Return file from inside an webxdc message.
*
- * @param msg The W30 instance.
+ * @memberof dc_msg_t
+ * @param msg The webxdc instance.
* @param filename The name inside the archive,
* must be given as a relative path (no leading `/`).
* @param ret_bytes Pointer to a size_t. The size of the blob will be written here.
* @return The blob must be released using dc_str_unref() after usage.
* NULL if there is no such file in the archive or on errors.
*/
-char* dc_msg_get_blob_from_archive (const dc_msg_t* msg, const char* filename, size_t* ret_bytes);
+char* dc_msg_get_webxdc_blob (const dc_msg_t* msg, const char* filename, size_t* ret_bytes);
/**
@@ -4848,12 +4848,12 @@ int64_t dc_lot_get_timestamp (const dc_lot_t* lot);
/**
- * w30-Message.
+ * webxdc-Message.
* Message with HTML5, CSS and related content.
*
- * To send data to a w30 instance, use dc_send_w30_status_update()
+ * To send data to a webxdc instance, use dc_send_webxdc_status_update()
*/
-#define DC_MSG_W30 80
+#define DC_MSG_WEBXDC 80
/**
@@ -5550,18 +5550,18 @@ void dc_event_unref(dc_event_t* event);
/**
- * w30 status update received.
- * To get the received status update, use dc_get_w30_status_updates().
- * To send status updates, use dc_send_w30_status_update().
+ * webxdc status update received.
+ * To get the received status update, use dc_get_webxdc_status_updates().
+ * To send status updates, use dc_send_webxdc_status_update().
*
* Note, that you do not get events that arrive when the app is not running;
- * instead, you can use dc_get_w30_status_updates() to get all status updates
+ * instead, you can use dc_get_webxdc_status_updates() to get all status updates
* and catch up that way.
*
* @param data1 (int) msg_id
* @param data2 (int) status_update_id
*/
-#define DC_EVENT_W30_STATUS_UPDATE 2120
+#define DC_EVENT_WEBXDC_STATUS_UPDATE 2120
/**
diff --git a/deltachat-ffi/src/lib.rs b/deltachat-ffi/src/lib.rs
index df15d9c00..dd850f2b7 100644
--- a/deltachat-ffi/src/lib.rs
+++ b/deltachat-ffi/src/lib.rs
@@ -37,7 +37,7 @@ use deltachat::ephemeral::Timer as EphemeralTimer;
use deltachat::key::DcKey;
use deltachat::message::MsgId;
use deltachat::stock_str::StockMessage;
-use deltachat::w30::StatusUpdateId;
+use deltachat::webxdc::StatusUpdateId;
use deltachat::*;
use deltachat::{accounts::Accounts, log::LogExt};
@@ -501,7 +501,7 @@ pub unsafe extern "C" fn dc_event_get_data1_int(event: *mut dc_event_t) -> libc:
EventType::ImexFileWritten(_) => 0,
EventType::SecurejoinInviterProgress { contact_id, .. }
| EventType::SecurejoinJoinerProgress { contact_id, .. } => *contact_id as libc::c_int,
- EventType::W30StatusUpdate { msg_id, .. } => msg_id.to_u32() as libc::c_int,
+ EventType::WebxdcStatusUpdate { msg_id, .. } => msg_id.to_u32() as libc::c_int,
}
}
@@ -543,7 +543,7 @@ pub unsafe extern "C" fn dc_event_get_data2_int(event: *mut dc_event_t) -> libc:
EventType::SecurejoinInviterProgress { progress, .. }
| EventType::SecurejoinJoinerProgress { progress, .. } => *progress as libc::c_int,
EventType::ChatEphemeralTimerModified { timer, .. } => timer.to_u32() as libc::c_int,
- EventType::W30StatusUpdate {
+ EventType::WebxdcStatusUpdate {
status_update_id, ..
} => status_update_id.to_u32() as libc::c_int,
}
@@ -587,7 +587,7 @@ pub unsafe extern "C" fn dc_event_get_data2_str(event: *mut dc_event_t) -> *mut
| EventType::SecurejoinJoinerProgress { .. }
| EventType::ConnectivityChanged
| EventType::SelfavatarChanged
- | EventType::W30StatusUpdate { .. }
+ | EventType::WebxdcStatusUpdate { .. }
| EventType::ChatEphemeralTimerModified { .. } => ptr::null_mut(),
EventType::ConfigureProgress { comment, .. } => {
if let Some(comment) = comment {
@@ -878,40 +878,40 @@ pub unsafe extern "C" fn dc_send_videochat_invitation(
}
#[no_mangle]
-pub unsafe extern "C" fn dc_send_w30_status_update(
+pub unsafe extern "C" fn dc_send_webxdc_status_update(
context: *mut dc_context_t,
msg_id: u32,
descr: *const libc::c_char,
json: *const libc::c_char,
) -> libc::c_int {
if context.is_null() {
- eprintln!("ignoring careless call to dc_send_w30_status_update()");
+ eprintln!("ignoring careless call to dc_send_webxdc_status_update()");
return 0;
}
let ctx = &*context;
- block_on(ctx.send_w30_status_update(
+ block_on(ctx.send_webxdc_status_update(
MsgId::new(msg_id),
&to_string_lossy(descr),
&to_string_lossy(json),
))
- .log_err(ctx, "Failed to send w30 update")
+ .log_err(ctx, "Failed to send webxdc update")
.is_ok() as libc::c_int
}
#[no_mangle]
-pub unsafe extern "C" fn dc_get_w30_status_updates(
+pub unsafe extern "C" fn dc_get_webxdc_status_updates(
context: *mut dc_context_t,
msg_id: u32,
status_update_id: u32,
) -> *mut libc::c_char {
if context.is_null() {
- eprintln!("ignoring careless call to dc_get_w30_status_updates()");
+ eprintln!("ignoring careless call to dc_get_webxdc_status_updates()");
return "".strdup();
}
let ctx = &*context;
- block_on(ctx.get_w30_status_updates(
+ block_on(ctx.get_webxdc_status_updates(
MsgId::new(msg_id),
if status_update_id == 0 {
None
@@ -3071,13 +3071,13 @@ pub unsafe extern "C" fn dc_msg_get_filename(msg: *mut dc_msg_t) -> *mut libc::c
}
#[no_mangle]
-pub unsafe extern "C" fn dc_msg_get_blob_from_archive(
+pub unsafe extern "C" fn dc_msg_get_webxdc_blob(
msg: *mut dc_msg_t,
filename: *const libc::c_char,
ret_bytes: *mut libc::size_t,
) -> *mut libc::c_char {
if msg.is_null() || filename.is_null() || ret_bytes.is_null() {
- eprintln!("ignoring careless call to dc_msg_get_blob_from_archive()");
+ eprintln!("ignoring careless call to dc_msg_get_webxdc_blob()");
return ptr::null_mut();
}
let ffi_msg = &*msg;
@@ -3085,7 +3085,7 @@ pub unsafe extern "C" fn dc_msg_get_blob_from_archive(
let blob = block_on(async move {
ffi_msg
.message
- .get_blob_from_archive(ctx, &to_string_lossy(filename))
+ .get_webxdc_blob(ctx, &to_string_lossy(filename))
.await
});
match blob {
diff --git a/draft/w30-user-guide.md b/draft/webxdc-user-guide.md
similarity index 70%
rename from draft/w30-user-guide.md
rename to draft/webxdc-user-guide.md
index 686513252..cb7b60acf 100644
--- a/draft/w30-user-guide.md
+++ b/draft/webxdc-user-guide.md
@@ -1,33 +1,33 @@
-# W30 User Guide
+# Webxdc User Guide
-## W30 File Format
+## Webxdc File Format
-- a **W30** app is a **ZIP-file** with the extension `.w30`
+- a **Webxdc app** is a **ZIP-file** with the extension `.xdc`
- the ZIP-file must contain at least the file `index.html`
-- if the W30 app is started, `index.html` is opened in a restricted webview
+- if the Webxdc app is started, `index.html` is opened in a restricted webview
that allow accessing resources only from the ZIP-file
-## W30 API
+## Webxdc API
-W30 apps can do anything that is allowed in webviews -
+Webxdc apps can do anything that is allowed in webviews -
html, css, images, canvas, javascript and so on.
-There are some additional APIs available once `deltachat.js` is included
+There are some additional APIs available once `webxdc.js` is included
(the file will be provided by the concrete implementations,
-no need to add `deltachat.js` to your ZIP-file):
+no need to add `webxdc.js` to your ZIP-file):
```
-
```
### sendUpdate()
```
-window.deltachat.sendUpdate(descr, payload);
+window.webxdc.sendUpdate(descr, payload);
```
-W30 apps are usually shared in a chat and run independently on each peer.
+Webxdc apps are usually shared in a chat and run independently on each peer.
To get a shared state, the peers use `sendUpdate()` to send updates to each other.
- `descr`: short, human-readable description what this update is about.
@@ -40,7 +40,7 @@ will receive the update by the callback given to `setUpdateListener()`.
### setUpdateListener()
```
-window.deltachat.setUpdateListener((update) => {});
+window.webxdc.setUpdateListener((update) => {});
```
With `setUpdateListener()` you define a callback that receives the updates
@@ -55,21 +55,21 @@ The callback is called for updates sent by you or other peers.
### getAllUpdates()
```
-payloads = window.deltachat.getAllUpdates()
+payloads = window.webxdc.getAllUpdates()
```
-In case your W30 was just started,
+In case your Webxdc was just started,
you may want to reconstruct the state from the last run -
and also incorporate updates that may have arrived while the app was not running.
- `payloads`: the function returns all previous updates in an array,
eg. `[{payload: "foo"},{payload: "bar"}]`
- if `deltachat.sendUpdate("foo"); deltachat.sendUpdate("bar");` was called on the last run.
+ if `webxdc.sendUpdate("foo"); webxdc.sendUpdate("bar");` was called on the last run.
### selfAddr()
```
-addr = window.deltachat.selfAddr()
+addr = window.webxdc.selfAddr()
```
Returns the peer's own address.
@@ -78,7 +78,7 @@ just send the address along with the payload,
and, if needed, compare the payload addresses against selfAddr() later on.
-## W30 Example
+## Webxdc Example
The following example shows an input field and every input is show on all peers.
@@ -87,7 +87,7 @@ The following example shows an input field and every input is show on all peers
-
+
@@ -97,21 +97,21 @@ The following example shows an input field and every input is show on all peers
function sendMsg() {
msg = document.getElementById("input").value;
- window.deltachat.sendUpdate('Someone typed "'+msg+'".', msg);
+ window.webxdc.sendUpdate('Someone typed "'+msg+'".', msg);
}
function receiveUpdate(update) {
document.getElementById('output').innerHTML += update.payload + " ";
}
- window.deltachat.setUpdateListener(receiveUpdate);
+ window.webxdc.setUpdateListener(receiveUpdate);
```
-For a more advanved example, see https://github.com/r10s/w30-poll/ .
+For a more advanved example, see https://github.com/r10s/webxdc-poll/ .
## Closing Remarks
diff --git a/examples/repl/cmdline.rs b/examples/repl/cmdline.rs
index 015345f1a..bb21d886c 100644
--- a/examples/repl/cmdline.rs
+++ b/examples/repl/cmdline.rs
@@ -387,7 +387,7 @@ pub async fn cmdline(context: Context, line: &str, chat_id: &mut ChatId) -> Resu
sendfile []\n\
sendhtml []\n\
sendsyncmsg\n\
- sendw30 \n\
+ sendupdate \n\
videochat\n\
draft []\n\
devicemsg \n\
@@ -908,14 +908,14 @@ pub async fn cmdline(context: Context, line: &str, chat_id: &mut ChatId) -> Resu
Some(msg_id) => println!("sync message sent as {}.", msg_id),
None => println!("sync message not needed."),
},
- "sendw30" => {
+ "sendupdate" => {
ensure!(
!arg1.is_empty() && !arg2.is_empty(),
"Arguments expected"
);
let msg_id = MsgId::new(arg1.parse()?);
context
- .send_w30_status_update(msg_id, "this is a w30 status update", arg2)
+ .send_webxdc_status_update(msg_id, "this is a webxdc status update", arg2)
.await?;
}
"videochat" => {
diff --git a/examples/repl/main.rs b/examples/repl/main.rs
index 86721cb4b..dc5aa6943 100644
--- a/examples/repl/main.rs
+++ b/examples/repl/main.rs
@@ -191,7 +191,7 @@ const CHAT_COMMANDS: [&str; 36] = [
"sendfile",
"sendhtml",
"sendsyncmsg",
- "sendw30",
+ "sendupdate",
"videochat",
"draft",
"listmedia",
diff --git a/src/chat.rs b/src/chat.rs
index c0dce7d98..edecee71e 100644
--- a/src/chat.rs
+++ b/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!(
diff --git a/src/constants.rs b/src/constants.rs
index 015e92f87..7fa3f347b 100644
--- a/src/constants.rs
+++ b/src/constants.rs
@@ -296,8 +296,8 @@ pub enum Viewtype {
/// Message is an invitation to a videochat.
VideochatInvitation = 70,
- /// Message is an w30 object.
- W30 = 80,
+ /// Message is an webxdc instance.
+ Webxdc = 80,
}
impl Default for Viewtype {
@@ -342,7 +342,7 @@ mod tests {
Viewtype::VideochatInvitation,
Viewtype::from_i32(70).unwrap()
);
- assert_eq!(Viewtype::W30, Viewtype::from_i32(80).unwrap());
+ assert_eq!(Viewtype::Webxdc, Viewtype::from_i32(80).unwrap());
}
#[test]
diff --git a/src/dc_receive_imf.rs b/src/dc_receive_imf.rs
index 4686e2690..9b60c6743 100644
--- a/src/dc_receive_imf.rs
+++ b/src/dc_receive_imf.rs
@@ -258,7 +258,7 @@ pub(crate) async fn dc_receive_imf_inner(
}
}
- if let Some(ref status_update) = mime_parser.w30_status_update {
+ if let Some(ref status_update) = mime_parser.webxdc_status_update {
if let Err(err) = context
.receive_status_update(insert_msg_id, status_update)
.await
@@ -869,7 +869,7 @@ async fn add_parts(
info!(context, "Existing non-decipherable message. (TRASH)");
}
- if mime_parser.w30_status_update.is_some() && mime_parser.parts.len() == 1 {
+ if mime_parser.webxdc_status_update.is_some() && mime_parser.parts.len() == 1 {
if let Some(part) = mime_parser.parts.first() {
if part.typ == Viewtype::Text && part.msg.is_empty() {
chat_id = Some(DC_CHAT_ID_TRASH);
diff --git a/src/events.rs b/src/events.rs
index 714262670..9040cd8d6 100644
--- a/src/events.rs
+++ b/src/events.rs
@@ -9,7 +9,7 @@ use strum::EnumProperty;
use crate::chat::ChatId;
use crate::ephemeral::Timer as EphemeralTimer;
use crate::message::MsgId;
-use crate::w30::StatusUpdateId;
+use crate::webxdc::StatusUpdateId;
#[derive(Debug)]
pub struct Events {
@@ -329,7 +329,7 @@ pub enum EventType {
SelfavatarChanged,
#[strum(props(id = "2120"))]
- W30StatusUpdate {
+ WebxdcStatusUpdate {
msg_id: MsgId,
status_update_id: StatusUpdateId,
},
diff --git a/src/lib.rs b/src/lib.rs
index 252aea7be..6a541ffaa 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -87,7 +87,7 @@ pub mod stock_str;
mod sync;
mod token;
mod update_helper;
-pub mod w30;
+pub mod webxdc;
#[macro_use]
mod dehtml;
mod color;
diff --git a/src/message.rs b/src/message.rs
index 6067c5de6..2fb04f121 100644
--- a/src/message.rs
+++ b/src/message.rs
@@ -1168,12 +1168,12 @@ pub fn guess_msgtype_from_suffix(path: &Path) -> Option<(Viewtype, &str)> {
"ttf" => (Viewtype::File, "font/ttf"),
"vcard" => (Viewtype::File, "text/vcard"),
"vcf" => (Viewtype::File, "text/vcard"),
- "w30" => (Viewtype::W30, "application/w30+zip"),
"wav" => (Viewtype::File, "audio/wav"),
"weba" => (Viewtype::File, "audio/webm"),
"webm" => (Viewtype::Video, "video/webm"),
"webp" => (Viewtype::Image, "image/webp"), // iOS via SDWebImage, Android since 4.0
"wmv" => (Viewtype::Video, "video/x-ms-wmv"),
+ "xdc" => (Viewtype::Webxdc, "application/webxdc+zip"),
"xhtml" => (Viewtype::File, "application/xhtml+xml"),
"xlsx" => (
Viewtype::File,
@@ -1704,8 +1704,8 @@ mod tests {
Some((Viewtype::File, "text/html"))
);
assert_eq!(
- guess_msgtype_from_suffix(Path::new("foo/file.w30")),
- Some((Viewtype::W30, "application/w30+zip"))
+ guess_msgtype_from_suffix(Path::new("foo/file.xdc")),
+ Some((Viewtype::Webxdc, "application/webxdc+zip"))
);
}
diff --git a/src/mimefactory.rs b/src/mimefactory.rs
index bce2fc559..ec32446e1 100644
--- a/src/mimefactory.rs
+++ b/src/mimefactory.rs
@@ -641,7 +641,7 @@ impl<'a> MimeFactory<'a> {
"Content-Type".to_string(),
"multipart/report; report-type=multi-device-sync".to_string(),
))
- } else if self.msg.param.get_cmd() == SystemMessage::W30StatusUpdate {
+ } else if self.msg.param.get_cmd() == SystemMessage::WebxdcStatusUpdate {
PartBuilder::new().header((
"Content-Type".to_string(),
"multipart/report; report-type=status-update".to_string(),
@@ -922,7 +922,7 @@ impl<'a> MimeFactory<'a> {
}
SystemMessage::LocationOnly
| SystemMessage::MultiDeviceSync
- | SystemMessage::W30StatusUpdate => {
+ | SystemMessage::WebxdcStatusUpdate => {
// This should prevent automatic replies,
// such as non-delivery reports.
//
@@ -1159,11 +1159,11 @@ impl<'a> MimeFactory<'a> {
let ids = self.msg.param.get(Param::Arg2).unwrap_or_default();
parts.push(context.build_sync_part(json.to_string()).await);
self.sync_ids_to_delete = Some(ids.to_string());
- } else if command == SystemMessage::W30StatusUpdate {
+ } else if command == SystemMessage::WebxdcStatusUpdate {
let json = self.msg.param.get(Param::Arg).unwrap_or_default();
parts.push(context.build_status_update_part(json).await);
- } else if self.msg.viewtype == Viewtype::W30 {
- let json = context.get_w30_status_updates(self.msg.id, None).await?;
+ } else if self.msg.viewtype == Viewtype::Webxdc {
+ let json = context.get_webxdc_status_updates(self.msg.id, None).await?;
if json != "[]" {
parts.push(context.build_status_update_part(&json).await);
}
diff --git a/src/mimeparser.rs b/src/mimeparser.rs
index 61d20c959..4e98b8fab 100644
--- a/src/mimeparser.rs
+++ b/src/mimeparser.rs
@@ -66,7 +66,7 @@ pub struct MimeMessage {
pub location_kml: Option,
pub message_kml: Option,
pub(crate) sync_items: Option,
- pub(crate) w30_status_update: Option,
+ pub(crate) webxdc_status_update: Option,
pub(crate) user_avatar: Option,
pub(crate) group_avatar: Option,
pub(crate) mdn_reports: Vec,
@@ -138,8 +138,8 @@ pub enum SystemMessage {
MultiDeviceSync = 20,
// Sync message that contains a json payload
- // sent to the other w30 instances
- W30StatusUpdate = 30,
+ // sent to the other webxdc instances
+ WebxdcStatusUpdate = 30,
}
impl Default for SystemMessage {
@@ -301,7 +301,7 @@ impl MimeMessage {
location_kml: None,
message_kml: None,
sync_items: None,
- w30_status_update: None,
+ webxdc_status_update: None,
user_avatar: None,
group_avatar: None,
failure_report: None,
@@ -544,7 +544,7 @@ impl MimeMessage {
};
if let Some(ref subject) = self.get_subject() {
- if !self.has_chat_version() && self.w30_status_update.is_none() {
+ if !self.has_chat_version() && self.webxdc_status_update.is_none() {
part.msg = subject.to_string();
}
}
@@ -1019,11 +1019,11 @@ impl MimeMessage {
return;
}
let msg_type = if context
- .is_w30_file(filename, decoded_data)
+ .is_webxdc_file(filename, decoded_data)
.await
.unwrap_or(false)
{
- Viewtype::W30
+ Viewtype::Webxdc
} else if filename.ends_with(".kml") {
// XXX what if somebody sends eg an "location-highlights.kml"
// attachment unrelated to location streaming?
@@ -1057,7 +1057,7 @@ impl MimeMessage {
let serialized = String::from_utf8_lossy(decoded_data)
.parse()
.unwrap_or_default();
- self.w30_status_update = Some(serialized);
+ self.webxdc_status_update = Some(serialized);
return;
} else {
msg_type
diff --git a/src/summary.rs b/src/summary.rs
index b8129c024..2257bb36e 100644
--- a/src/summary.rs
+++ b/src/summary.rs
@@ -137,9 +137,9 @@ impl Message {
append_text = false;
stock_str::videochat_invitation(context).await
}
- Viewtype::W30 => {
+ Viewtype::Webxdc => {
append_text = true;
- "W30".to_string()
+ "Webxdc".to_string()
}
Viewtype::Text | Viewtype::Unknown => {
if self.param.get_cmd() != SystemMessage::LocationOnly {
diff --git a/src/w30.rs b/src/webxdc.rs
similarity index 74%
rename from src/w30.rs
rename to src/webxdc.rs
index 0a2a58943..904c7a823 100644
--- a/src/w30.rs
+++ b/src/webxdc.rs
@@ -1,4 +1,4 @@
-//! # Handle W30 messages.
+//! # Handle webxdc messages.
use crate::constants::Viewtype;
use crate::context::Context;
@@ -15,7 +15,7 @@ use serde_json::Value;
use std::convert::TryFrom;
use std::io::Read;
-pub const W30_SUFFIX: &str = "w30";
+pub const WEBXDC_SUFFIX: &str = "xdc";
/// Status Update ID.
#[derive(
@@ -51,8 +51,8 @@ pub(crate) struct StatusUpdateItem {
}
impl Context {
- pub(crate) async fn is_w30_file(&self, filename: &str, buf: &[u8]) -> Result {
- if filename.ends_with(W30_SUFFIX) {
+ pub(crate) async fn is_webxdc_file(&self, filename: &str, buf: &[u8]) -> Result {
+ if filename.ends_with(WEBXDC_SUFFIX) {
let reader = std::io::Cursor::new(buf);
if let Ok(mut archive) = zip::ZipArchive::new(reader) {
if let Ok(_index_html) = archive.by_name("index.html") {
@@ -85,22 +85,22 @@ impl Context {
Ok(StatusUpdateId(u32::try_from(rowid)?))
}
- /// Sends a status update for an w30 instance.
+ /// Sends a status update for an webxdc instance.
///
/// If the instance is a draft,
/// the status update is sent once the instance is actually sent.
///
/// If an update is sent immediately, the message-id of the update-message is returned,
/// this update-message is visible in chats, however, the id may be useful.
- pub async fn send_w30_status_update(
+ pub async fn send_webxdc_status_update(
&self,
instance_msg_id: MsgId,
descr: &str,
payload: &str,
) -> Result