diff --git a/deltachat-ffi/src/lib.rs b/deltachat-ffi/src/lib.rs index c52404cc4..5ecb31709 100644 --- a/deltachat-ffi/src/lib.rs +++ b/deltachat-ffi/src/lib.rs @@ -559,7 +559,7 @@ pub unsafe extern "C" fn dc_event_get_id(event: *mut dc_event_t) -> libc::c_int EventType::ConfigSynced { .. } => 2111, EventType::WebxdcStatusUpdate { .. } => 2120, EventType::WebxdcInstanceDeleted { .. } => 2121, - EventType::BackgroundFetchCompletedForAllAccounts => 2200, + EventType::AccountsBackgroundFetchDone => 2200, } } @@ -588,7 +588,7 @@ pub unsafe extern "C" fn dc_event_get_data1_int(event: *mut dc_event_t) -> libc: | EventType::ConfigSynced { .. } | EventType::IncomingMsgBunch { .. } | EventType::ErrorSelfNotInGroup(_) - | EventType::BackgroundFetchCompletedForAllAccounts => 0, + | EventType::AccountsBackgroundFetchDone => 0, EventType::MsgsChanged { chat_id, .. } | EventType::ReactionsChanged { chat_id, .. } | EventType::IncomingMsg { chat_id, .. } @@ -648,7 +648,7 @@ pub unsafe extern "C" fn dc_event_get_data2_int(event: *mut dc_event_t) -> libc: | EventType::WebxdcInstanceDeleted { .. } | EventType::IncomingMsgBunch { .. } | EventType::SelfavatarChanged - | EventType::BackgroundFetchCompletedForAllAccounts + | EventType::AccountsBackgroundFetchDone | EventType::ConfigSynced { .. } => 0, EventType::ChatModified(_) => 0, EventType::MsgsChanged { msg_id, .. } @@ -711,7 +711,7 @@ pub unsafe extern "C" fn dc_event_get_data2_str(event: *mut dc_event_t) -> *mut | EventType::SelfavatarChanged | EventType::WebxdcStatusUpdate { .. } | EventType::WebxdcInstanceDeleted { .. } - | EventType::BackgroundFetchCompletedForAllAccounts + | EventType::AccountsBackgroundFetchDone | EventType::ChatEphemeralTimerModified { .. } => ptr::null_mut(), EventType::ConfigureProgress { comment, .. } => { if let Some(comment) = comment { diff --git a/deltachat-jsonrpc/src/api.rs b/deltachat-jsonrpc/src/api.rs index 4d009f636..f8e46c50f 100644 --- a/deltachat-jsonrpc/src/api.rs +++ b/deltachat-jsonrpc/src/api.rs @@ -233,7 +233,7 @@ impl CommandApi { /// Performs a background fetch for all accounts in parallel with a timeout. /// - /// The `BackgroundFetchCompletedForAllAccounts` event is emitted at the end, + /// The `AccountsBackgroundFetchDone` event is emitted at the end, /// process all events until you get this one and you can safely return to the background /// without forgeting to create notifications caused by timing race conditions. async fn background_fetch_for_all_accounts(&self, timeout_in_seconds: f64) -> Result<()> { diff --git a/deltachat-jsonrpc/src/api/types/events.rs b/deltachat-jsonrpc/src/api/types/events.rs index a92ef2e03..e6f441f84 100644 --- a/deltachat-jsonrpc/src/api/types/events.rs +++ b/deltachat-jsonrpc/src/api/types/events.rs @@ -251,7 +251,7 @@ pub enum EventType { /// that all events emitted during the background fetch were processed. /// /// This event is only emitted by the account manager - BackgroundFetchCompletedForAllAccounts, + AccountsBackgroundFetchDone, } impl From for EventType { @@ -360,9 +360,7 @@ impl From for EventType { CoreEventType::WebxdcInstanceDeleted { msg_id } => WebxdcInstanceDeleted { msg_id: msg_id.to_u32(), }, - CoreEventType::BackgroundFetchCompletedForAllAccounts => { - BackgroundFetchCompletedForAllAccounts - } + CoreEventType::AccountsBackgroundFetchDone => AccountsBackgroundFetchDone, } } } diff --git a/src/accounts.rs b/src/accounts.rs index 11c1db641..41ca2f436 100644 --- a/src/accounts.rs +++ b/src/accounts.rs @@ -296,7 +296,7 @@ impl Accounts { /// /// If you need a timeout, then use [Accounts::background_fetch_with_timeout] instead. /// - /// The `BackgroundFetchCompletedForAllAccounts` event is emitted at the end, + /// The `AccountsBackgroundFetchDone` event is emitted at the end, /// process all events until you get this one and you can safely return to the background /// without forgeting to create notifications caused by timing race conditions. pub async fn background_fetch(&self) { @@ -314,19 +314,19 @@ impl Accounts { ) .await; - self.emit_event(EventType::BackgroundFetchCompletedForAllAccounts); + self.emit_event(EventType::AccountsBackgroundFetchDone); } /// Performs a background fetch for all accounts in parallel with a timeout. /// /// If you want no timeout, then use [Accounts::background_fetch] instead. /// - /// The `BackgroundFetchCompletedForAllAccounts` event is emitted at the end, + /// The `AccountsBackgroundFetchDone` event is emitted at the end, /// process all events until you get this one and you can safely return to the background /// without forgeting to create notifications caused by timing race conditions. pub async fn background_fetch_with_timeout(&self, timeout: std::time::Duration) -> Result<()> { let result = tokio::time::timeout(timeout, self.background_fetch()).await; - self.emit_event(EventType::BackgroundFetchCompletedForAllAccounts); + self.emit_event(EventType::AccountsBackgroundFetchDone); result.map_err(|err| err.into()) } diff --git a/src/events/payload.rs b/src/events/payload.rs index 43c167362..771088ab1 100644 --- a/src/events/payload.rs +++ b/src/events/payload.rs @@ -293,5 +293,5 @@ pub enum EventType { /// that all events emitted during the background fetch were processed. /// /// This event is only emitted by the account manager - BackgroundFetchCompletedForAllAccounts, + AccountsBackgroundFetchDone, }