Skip to content

Commit 727428a

Browse files
Simon-Lauxr10s
authored andcommitted
rename event and mention event in method documentation
1 parent df455bb commit 727428a

File tree

4 files changed

+19
-3
lines changed

4 files changed

+19
-3
lines changed

deltachat-ffi/deltachat.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3157,6 +3157,10 @@ void dc_accounts_maybe_network_lost (dc_accounts_t* accounts);
31573157
*
31583158
* dc_accounts_background_fetch() was created for the iOS Background fetch.
31593159
*
3160+
* The `DC_EVENT_ACCOUNTS_BACKGROUND_FETCH_DONE` event is emitted at the end,
3161+
* process all events until you get this one and you can safely return to the background
3162+
* without forgeting to create notifications caused by timing race conditions.
3163+
*
31603164
* @memberof dc_accounts_t
31613165
* @param timeout The timeout in seconds
31623166
* @return Return 1 on success and 0 on failure (like timeout)
@@ -6278,7 +6282,7 @@ void dc_event_unref(dc_event_t* event);
62786282
* This event is only emitted by the account manager
62796283
*/
62806284

6281-
#define DC_EVENT_BACKGROUND_FETCH_COMPLETED_FOR_ALL_ACCOUNTS 2200
6285+
#define DC_EVENT_ACCOUNTS_BACKGROUND_FETCH_DONE 2200
62826286

62836287
/**
62846288
* @}

deltachat-jsonrpc/src/api.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,10 @@ impl CommandApi {
232232
}
233233

234234
/// Performs a background fetch for all accounts in parallel with a timeout.
235+
///
236+
/// The `BackgroundFetchCompletedForAllAccounts` event is emitted at the end,
237+
/// process all events until you get this one and you can safely return to the background
238+
/// without forgeting to create notifications caused by timing race conditions.
235239
async fn background_fetch_for_all_accounts(&self, timeout_in_seconds: f64) -> Result<()> {
236240
self.accounts
237241
.write()

node/lib/constants.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export enum C {
2929
DC_DOWNLOAD_FAILURE = 20,
3030
DC_DOWNLOAD_IN_PROGRESS = 1000,
3131
DC_DOWNLOAD_UNDECIPHERABLE = 30,
32-
DC_EVENT_BACKGROUND_FETCH_COMPLETED_FOR_ALL_ACCOUNTS = 2200,
32+
DC_EVENT_ACCOUNTS_BACKGROUND_FETCH_DONE = 2200,
3333
DC_EVENT_CHAT_EPHEMERAL_TIMER_MODIFIED = 2021,
3434
DC_EVENT_CHAT_MODIFIED = 2020,
3535
DC_EVENT_CONFIGURE_PROGRESS = 2041,
@@ -327,5 +327,5 @@ export const EventId2EventName: { [key: number]: string } = {
327327
2111: 'DC_EVENT_CONFIG_SYNCED',
328328
2120: 'DC_EVENT_WEBXDC_STATUS_UPDATE',
329329
2121: 'DC_EVENT_WEBXDC_INSTANCE_DELETED',
330-
2200: 'DC_EVENT_BACKGROUND_FETCH_COMPLETED_FOR_ALL_ACCOUNTS',
330+
2200: 'DC_EVENT_ACCOUNTS_BACKGROUND_FETCH_DONE',
331331
}

src/accounts.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,10 @@ impl Accounts {
295295
/// Performs a background fetch for all accounts in parallel.
296296
///
297297
/// If you need a timeout, then use [Accounts::background_fetch_with_timeout] instead.
298+
///
299+
/// The `BackgroundFetchCompletedForAllAccounts` event is emitted at the end,
300+
/// process all events until you get this one and you can safely return to the background
301+
/// without forgeting to create notifications caused by timing race conditions.
298302
pub async fn background_fetch(&self) {
299303
async fn background_fetch_and_log_error(account: Context) {
300304
if let Err(error) = account.background_fetch().await {
@@ -316,6 +320,10 @@ impl Accounts {
316320
/// Performs a background fetch for all accounts in parallel with a timeout.
317321
///
318322
/// If you want no timeout, then use [Accounts::background_fetch] instead.
323+
///
324+
/// The `BackgroundFetchCompletedForAllAccounts` event is emitted at the end,
325+
/// process all events until you get this one and you can safely return to the background
326+
/// without forgeting to create notifications caused by timing race conditions.
319327
pub async fn background_fetch_with_timeout(&self, timeout: std::time::Duration) -> Result<()> {
320328
let result = tokio::time::timeout(timeout, self.background_fetch()).await;
321329
self.emit_event(EventType::BackgroundFetchCompletedForAllAccounts);

0 commit comments

Comments
 (0)