api!: consistent spelling of "canceled" with a single "l"

This is how it is spelled in iOS UI and Android APIs.
This commit is contained in:
link2xt
2025-10-01 14:57:22 +00:00
committed by l
parent a668047f75
commit 38e4919be1
9 changed files with 49 additions and 49 deletions

View File

@@ -1764,7 +1764,7 @@ This reverts commit 6f22ce2722b51773d7fbb0d89e4764f963cafd91..
### Fixes ### Fixes
- Reset quota on configured address change ([#5908](https://github.com/chatmail/core/pull/5908)). - Reset quota on configured address change ([#5908](https://github.com/chatmail/core/pull/5908)).
- Do not emit progress 1000 when configuration is cancelled. - Do not emit progress 1000 when configuration is canceled.
- Assume file extensions are 32 chars max and don't contain whitespace ([#5338](https://github.com/chatmail/core/pull/5338)). - Assume file extensions are 32 chars max and don't contain whitespace ([#5338](https://github.com/chatmail/core/pull/5338)).
- Re-add tokens.foreign_id column ([#6038](https://github.com/chatmail/core/pull/6038)). - Re-add tokens.foreign_id column ([#6038](https://github.com/chatmail/core/pull/6038)).
@@ -4212,7 +4212,7 @@ Bugfix release attempting to fix the [iOS build error](https://github.com/chatma
- Recreate `smtp` table with AUTOINCREMENT `id` ([#4390](https://github.com/chatmail/core/pull/4390)). - Recreate `smtp` table with AUTOINCREMENT `id` ([#4390](https://github.com/chatmail/core/pull/4390)).
- Do not return an error from `send_msg_to_smtp` if retry limit is exceeded. - Do not return an error from `send_msg_to_smtp` if retry limit is exceeded.
- Make the bots automatically accept group chat contact requests ([#4377](https://github.com/chatmail/core/pull/4377)). - Make the bots automatically accept group chat contact requests ([#4377](https://github.com/chatmail/core/pull/4377)).
- Delete `smtp` rows when message sending is cancelled ([#4391](https://github.com/chatmail/core/pull/4391)). - Delete `smtp` rows when message sending is canceled ([#4391](https://github.com/chatmail/core/pull/4391)).
### Refactor ### Refactor
@@ -4223,7 +4223,7 @@ Bugfix release attempting to fix the [iOS build error](https://github.com/chatma
### Fixes ### Fixes
- Fetch at most 100 existing messages even if EXISTS was not received. - Fetch at most 100 existing messages even if EXISTS was not received.
- Delete `smtp` rows when message sending is cancelled. - Delete `smtp` rows when message sending is canceled.
### Changes ### Changes
@@ -4310,14 +4310,14 @@ Bugfix release attempting to fix the [iOS build error](https://github.com/chatma
## [1.112.3] - 2023-03-30 ## [1.112.3] - 2023-03-30
### Fixes ### Fixes
- `transfer::get_backup` now frees ongoing process when cancelled. #4249 - `transfer::get_backup` now frees ongoing process when canceled. #4249
## [1.112.2] - 2023-03-30 ## [1.112.2] - 2023-03-30
### Changes ### Changes
- Update iroh, remove `default-net` from `[patch.crates-io]` section. - Update iroh, remove `default-net` from `[patch.crates-io]` section.
- transfer backup: Connect to multiple provider addresses concurrently. This should speed up connection time significantly on the getter side. #4240 - transfer backup: Connect to multiple provider addresses concurrently. This should speed up connection time significantly on the getter side. #4240
- Make sure BackupProvider is cancelled on drop (or `dc_backup_provider_unref`). The BackupProvider will now always finish with an IMEX event of 1000 or 0, previously it would sometimes finished with 1000 (success) when it really was 0 (failure). #4242 - Make sure BackupProvider is canceled on drop (or `dc_backup_provider_unref`). The BackupProvider will now always finish with an IMEX event of 1000 or 0, previously it would sometimes finished with 1000 (success) when it really was 0 (failure). #4242
### Fixes ### Fixes
- Do not return media from trashed messages in the "All media" view. #4247 - Do not return media from trashed messages in the "All media" view. #4247

View File

@@ -44,7 +44,7 @@ If you want to contribute a code, follow this guide.
The following prefix types are used: The following prefix types are used:
- `feat`: Features, e.g. "feat: Pause IO for BackupProvider". If you are unsure what's the category of your commit, you can often just use `feat`. - `feat`: Features, e.g. "feat: Pause IO for BackupProvider". If you are unsure what's the category of your commit, you can often just use `feat`.
- `fix`: Bug fixes, e.g. "fix: delete `smtp` rows when message sending is cancelled" - `fix`: Bug fixes, e.g. "fix: delete `smtp` rows when message sending is canceled"
- `api`: API changes, e.g. "api(rust): add `get_msg_read_receipts(context, msg_id)`" - `api`: API changes, e.g. "api(rust): add `get_msg_read_receipts(context, msg_id)`"
- `refactor`: Refactorings, e.g. "refactor: iterate over `msg_ids` without `.iter()`" - `refactor`: Refactorings, e.g. "refactor: iterate over `msg_ids` without `.iter()`"
- `perf`: Performance improvements, e.g. "perf: improve SQLite performance with `PRAGMA synchronous=normal`" - `perf`: Performance improvements, e.g. "perf: improve SQLite performance with `PRAGMA synchronous=normal`"

View File

@@ -1230,7 +1230,7 @@ uint32_t dc_init_webxdc_integration (dc_context_t* context, uint32_t c
* *
* - callee declines using dc_end_call(): * - callee declines using dc_end_call():
* caller receives #DC_EVENT_CALL_ENDED and has a "Declinced Call". * caller receives #DC_EVENT_CALL_ENDED and has a "Declinced Call".
* callee's other devices receive #DC_EVENT_CALL_ENDED and have a "Cancelled Call", * callee's other devices receive #DC_EVENT_CALL_ENDED and have a "Canceled Call",
* *
* - callee is already in a call: * - callee is already in a call:
* in this case, UI may decide to show a notification instead of ringing. * in this case, UI may decide to show a notification instead of ringing.
@@ -1241,7 +1241,7 @@ uint32_t dc_init_webxdc_integration (dc_context_t* context, uint32_t c
* caller and callee receive #DC_EVENT_CALL_ENDED * caller and callee receive #DC_EVENT_CALL_ENDED
* to prevent endless ringing of callee * to prevent endless ringing of callee
* in case caller got offline without being able to send cancellation message. * in case caller got offline without being able to send cancellation message.
* for caller, this is a "Cancelled Call"; * for caller, this is a "Canceled Call";
* for callee, this is a "Missed Call" * for callee, this is a "Missed Call"
* *
* Actions during the call: * Actions during the call:

View File

@@ -1809,13 +1809,13 @@ impl CommandApi {
/// Offers a backup for remote devices to retrieve. /// Offers a backup for remote devices to retrieve.
/// ///
/// Can be cancelled by stopping the ongoing process. Success or failure can be tracked /// Can be canceled by stopping the ongoing process. Success or failure can be tracked
/// via the `ImexProgress` event which should either reach `1000` for success or `0` for /// via the `ImexProgress` event which should either reach `1000` for success or `0` for
/// failure. /// failure.
/// ///
/// This **stops IO** while it is running. /// This **stops IO** while it is running.
/// ///
/// Returns once a remote device has retrieved the backup, or is cancelled. /// Returns once a remote device has retrieved the backup, or is canceled.
async fn provide_backup(&self, account_id: u32) -> Result<()> { async fn provide_backup(&self, account_id: u32) -> Result<()> {
let ctx = self.get_context(account_id).await?; let ctx = self.get_context(account_id).await?;
@@ -1881,7 +1881,7 @@ impl CommandApi {
/// This retrieves the backup from a remote device over the network and imports it into /// This retrieves the backup from a remote device over the network and imports it into
/// the current device. /// the current device.
/// ///
/// Can be cancelled by stopping the ongoing process. /// Can be canceled by stopping the ongoing process.
/// ///
/// Do not forget to call start_io on the account after a successful import, /// Do not forget to call start_io on the account after a successful import,
/// otherwise it will not connect to the email server. /// otherwise it will not connect to the email server.

View File

@@ -20,7 +20,7 @@ pub struct JsonrpcCallInfo {
/// Call state. /// Call state.
/// ///
/// For example, if the call is accepted, active, cancelled, declined etc. /// For example, if the call is accepted, active, canceled, declined etc.
pub state: JsonrpcCallState, pub state: JsonrpcCallState,
} }
@@ -68,13 +68,13 @@ pub enum JsonrpcCallState {
/// that was declined before the timeout. /// that was declined before the timeout.
Declined, Declined,
/// Outgoing call that has been cancelled on our side /// Outgoing call that has been canceled on our side
/// before receiving a response. /// before receiving a response.
/// ///
/// Incoming calls cannot be cancelled, /// Incoming calls cannot be canceled,
/// on the receiver side cancelled calls /// on the receiver side canceled calls
/// usually result in missed calls. /// usually result in missed calls.
Cancelled, Canceled,
} }
impl JsonrpcCallState { impl JsonrpcCallState {
@@ -87,7 +87,7 @@ impl JsonrpcCallState {
CallState::Completed { duration } => JsonrpcCallState::Completed { duration }, CallState::Completed { duration } => JsonrpcCallState::Completed { duration },
CallState::Missed => JsonrpcCallState::Missed, CallState::Missed => JsonrpcCallState::Missed,
CallState::Declined => JsonrpcCallState::Declined, CallState::Declined => JsonrpcCallState::Declined,
CallState::Cancelled => JsonrpcCallState::Cancelled, CallState::Canceled => JsonrpcCallState::Canceled,
}; };
Ok(jsonrpc_call_state) Ok(jsonrpc_call_state)

View File

@@ -46,9 +46,9 @@ const STUN_PORT: u16 = 3478;
/// ///
/// It is used to distinguish "ended" calls /// It is used to distinguish "ended" calls
/// that are rejected by us from the calls /// that are rejected by us from the calls
/// cancelled by the other side /// canceled by the other side
/// immediately after ringing started. /// immediately after ringing started.
const CALL_CANCELLED_TIMESTAMP: Param = Param::Arg2; const CALL_CANCELED_TIMESTAMP: Param = Param::Arg2;
/// Information about the status of a call. /// Information about the status of a call.
#[derive(Debug, Default)] #[derive(Debug, Default)]
@@ -123,14 +123,14 @@ impl CallInfo {
} }
/// Returns true if the call is missed /// Returns true if the call is missed
/// because the caller cancelled it /// because the caller canceled it
/// explicitly before ringing stopped. /// explicitly before ringing stopped.
/// ///
/// For outgoing calls this means /// For outgoing calls this means
/// the receiver has rejected the call /// the receiver has rejected the call
/// explicitly. /// explicitly.
pub fn is_cancelled(&self) -> bool { pub fn is_canceled(&self) -> bool {
self.msg.param.exists(CALL_CANCELLED_TIMESTAMP) self.msg.param.exists(CALL_CANCELED_TIMESTAMP)
} }
async fn mark_as_ended(&mut self, context: &Context) -> Result<()> { async fn mark_as_ended(&mut self, context: &Context) -> Result<()> {
@@ -139,17 +139,17 @@ impl CallInfo {
Ok(()) Ok(())
} }
/// Explicitly mark the call as cancelled. /// Explicitly mark the call as canceled.
/// ///
/// For incoming calls this should be called /// For incoming calls this should be called
/// when "call ended" message is received /// when "call ended" message is received
/// from the caller before we picked up the call. /// from the caller before we picked up the call.
/// In this case the call becomes "missed" early /// In this case the call becomes "missed" early
/// before the ringing timeout. /// before the ringing timeout.
async fn mark_as_cancelled(&mut self, context: &Context) -> Result<()> { async fn mark_as_canceled(&mut self, context: &Context) -> Result<()> {
let now = time(); let now = time();
self.msg.param.set_i64(CALL_ENDED_TIMESTAMP, now); self.msg.param.set_i64(CALL_ENDED_TIMESTAMP, now);
self.msg.param.set_i64(CALL_CANCELLED_TIMESTAMP, now); self.msg.param.set_i64(CALL_CANCELED_TIMESTAMP, now);
self.msg.update_param(context).await?; self.msg.update_param(context).await?;
Ok(()) Ok(())
} }
@@ -255,8 +255,8 @@ impl Context {
call.mark_as_ended(self).await?; call.mark_as_ended(self).await?;
call.update_text(self, "Declined call").await?; call.update_text(self, "Declined call").await?;
} else { } else {
call.mark_as_cancelled(self).await?; call.mark_as_canceled(self).await?;
call.update_text(self, "Cancelled call").await?; call.update_text(self, "Canceled call").await?;
} }
} else { } else {
call.mark_as_ended(self).await?; call.mark_as_ended(self).await?;
@@ -290,11 +290,11 @@ impl Context {
let mut call = context.load_call_by_id(call_id).await?; let mut call = context.load_call_by_id(call_id).await?;
if !call.is_accepted() && !call.is_ended() { if !call.is_accepted() && !call.is_ended() {
if call.is_incoming() { if call.is_incoming() {
call.mark_as_cancelled(&context).await?; call.mark_as_canceled(&context).await?;
call.update_text(&context, "Missed call").await?; call.update_text(&context, "Missed call").await?;
} else { } else {
call.mark_as_ended(&context).await?; call.mark_as_ended(&context).await?;
call.update_text(&context, "Cancelled call").await?; call.update_text(&context, "Canceled call").await?;
} }
context.emit_msgs_changed(call.msg.chat_id, call_id); context.emit_msgs_changed(call.msg.chat_id, call_id);
context.emit_event(EventType::CallEnded { context.emit_event(EventType::CallEnded {
@@ -386,14 +386,14 @@ impl Context {
call.mark_as_ended(self).await?; call.mark_as_ended(self).await?;
call.update_text(self, "Declined call").await?; call.update_text(self, "Declined call").await?;
} else { } else {
call.mark_as_cancelled(self).await?; call.mark_as_canceled(self).await?;
call.update_text(self, "Missed call").await?; call.update_text(self, "Missed call").await?;
} }
} else { } else {
// outgoing // outgoing
if from_id == ContactId::SELF { if from_id == ContactId::SELF {
call.mark_as_cancelled(self).await?; call.mark_as_canceled(self).await?;
call.update_text(self, "Cancelled call").await?; call.update_text(self, "Canceled call").await?;
} else { } else {
call.mark_as_ended(self).await?; call.mark_as_ended(self).await?;
call.update_text(self, "Declined call").await?; call.update_text(self, "Declined call").await?;
@@ -483,13 +483,13 @@ pub enum CallState {
/// that was declined before the timeout. /// that was declined before the timeout.
Declined, Declined,
/// Outgoing call that has been cancelled on our side /// Outgoing call that has been canceled on our side
/// before receiving a response. /// before receiving a response.
/// ///
/// Incoming calls cannot be cancelled, /// Incoming calls cannot be canceled,
/// on the receiver side cancelled calls /// on the receiver side canceled calls
/// usually result in missed calls. /// usually result in missed calls.
Cancelled, Canceled,
} }
/// Returns call state given the message ID. /// Returns call state given the message ID.
@@ -504,8 +504,8 @@ pub async fn call_state(context: &Context, msg_id: MsgId) -> Result<CallState> {
} else { } else {
CallState::Active CallState::Active
} }
} else if call.is_cancelled() { } else if call.is_canceled() {
// Call was explicitly cancelled // Call was explicitly canceled
// by the caller before we picked it up. // by the caller before we picked it up.
CallState::Missed CallState::Missed
} else if call.is_ended() { } else if call.is_ended() {
@@ -523,8 +523,8 @@ pub async fn call_state(context: &Context, msg_id: MsgId) -> Result<CallState> {
} else { } else {
CallState::Active CallState::Active
} }
} else if call.is_cancelled() { } else if call.is_canceled() {
CallState::Cancelled CallState::Canceled
} else if call.is_ended() || call.is_stale() { } else if call.is_ended() || call.is_stale() {
CallState::Declined CallState::Declined
} else { } else {

View File

@@ -368,7 +368,7 @@ async fn test_caller_cancels_call() -> Result<()> {
// Alice changes their mind before Bob picks up // Alice changes their mind before Bob picks up
alice.end_call(alice_call.id).await?; alice.end_call(alice_call.id).await?;
assert_text(&alice, alice_call.id, "Cancelled call").await?; assert_text(&alice, alice_call.id, "Canceled call").await?;
alice alice
.evtracker .evtracker
.get_matching(|evt| matches!(evt, EventType::CallEnded { .. })) .get_matching(|evt| matches!(evt, EventType::CallEnded { .. }))
@@ -376,18 +376,18 @@ async fn test_caller_cancels_call() -> Result<()> {
let sent3 = alice.pop_sent_msg().await; let sent3 = alice.pop_sent_msg().await;
assert_eq!( assert_eq!(
call_state(&alice, alice_call.id).await?, call_state(&alice, alice_call.id).await?,
CallState::Cancelled CallState::Canceled
); );
alice2.recv_msg_trash(&sent3).await; alice2.recv_msg_trash(&sent3).await;
assert_text(&alice2, alice2_call.id, "Cancelled call").await?; assert_text(&alice2, alice2_call.id, "Canceled call").await?;
alice2 alice2
.evtracker .evtracker
.get_matching(|evt| matches!(evt, EventType::CallEnded { .. })) .get_matching(|evt| matches!(evt, EventType::CallEnded { .. }))
.await; .await;
assert_eq!( assert_eq!(
call_state(&alice2, alice2_call.id).await?, call_state(&alice2, alice2_call.id).await?,
CallState::Cancelled CallState::Canceled
); );
// Bob receives the ending message // Bob receives the ending message

View File

@@ -137,7 +137,7 @@ impl Context {
let res = self let res = self
.inner_configure(param) .inner_configure(param)
.race(cancel_channel.recv().map(|_| Err(format_err!("Cancelled")))) .race(cancel_channel.recv().map(|_| Err(format_err!("Canceled"))))
.await; .await;
self.free_ongoing().await; self.free_ongoing().await;

View File

@@ -242,7 +242,7 @@ impl BackupProvider {
if let Err(err) = Self::handle_connection(context.clone(), conn, auth_token, dbfile).race( if let Err(err) = Self::handle_connection(context.clone(), conn, auth_token, dbfile).race(
async { async {
cancel_token.recv().await.ok(); cancel_token.recv().await.ok();
Err(format_err!("Backup transfer cancelled")) Err(format_err!("Backup transfer canceled"))
} }
).race( ).race(
async { async {
@@ -262,12 +262,12 @@ impl BackupProvider {
} }
}, },
_ = cancel_token.recv() => { _ = cancel_token.recv() => {
info!(context, "Backup transfer cancelled by the user, stopping accept loop."); info!(context, "Backup transfer canceled by the user, stopping accept loop.");
context.emit_event(EventType::ImexProgress(0)); context.emit_event(EventType::ImexProgress(0));
break; break;
} }
_ = drop_token.cancelled() => { _ = drop_token.cancelled() => {
info!(context, "Backup transfer cancelled by dropping the provider, stopping accept loop."); info!(context, "Backup transfer canceled by dropping the provider, stopping accept loop.");
context.emit_event(EventType::ImexProgress(0)); context.emit_event(EventType::ImexProgress(0));
break; break;
} }
@@ -364,7 +364,7 @@ pub async fn get_backup(context: &Context, qr: Qr) -> Result<()> {
let res = get_backup2(context, node_addr, auth_token) let res = get_backup2(context, node_addr, auth_token)
.race(async { .race(async {
cancel_token.recv().await.ok(); cancel_token.recv().await.ok();
Err(format_err!("Backup reception cancelled")) Err(format_err!("Backup reception canceled"))
}) })
.await; .await;
if let Err(ref res) = res { if let Err(ref res) = res {