Skip to content

Commit de86b8a

Browse files
Simon-Lauxr10s
authored andcommitted
rename event also in core
1 parent 060c9c8 commit de86b8a

File tree

5 files changed

+12
-14
lines changed

5 files changed

+12
-14
lines changed

deltachat-ffi/src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,7 @@ pub unsafe extern "C" fn dc_event_get_id(event: *mut dc_event_t) -> libc::c_int
559559
EventType::ConfigSynced { .. } => 2111,
560560
EventType::WebxdcStatusUpdate { .. } => 2120,
561561
EventType::WebxdcInstanceDeleted { .. } => 2121,
562-
EventType::BackgroundFetchCompletedForAllAccounts => 2200,
562+
EventType::AccountsBackgroundFetchDone => 2200,
563563
}
564564
}
565565

@@ -588,7 +588,7 @@ pub unsafe extern "C" fn dc_event_get_data1_int(event: *mut dc_event_t) -> libc:
588588
| EventType::ConfigSynced { .. }
589589
| EventType::IncomingMsgBunch { .. }
590590
| EventType::ErrorSelfNotInGroup(_)
591-
| EventType::BackgroundFetchCompletedForAllAccounts => 0,
591+
| EventType::AccountsBackgroundFetchDone => 0,
592592
EventType::MsgsChanged { chat_id, .. }
593593
| EventType::ReactionsChanged { chat_id, .. }
594594
| EventType::IncomingMsg { chat_id, .. }
@@ -648,7 +648,7 @@ pub unsafe extern "C" fn dc_event_get_data2_int(event: *mut dc_event_t) -> libc:
648648
| EventType::WebxdcInstanceDeleted { .. }
649649
| EventType::IncomingMsgBunch { .. }
650650
| EventType::SelfavatarChanged
651-
| EventType::BackgroundFetchCompletedForAllAccounts
651+
| EventType::AccountsBackgroundFetchDone
652652
| EventType::ConfigSynced { .. } => 0,
653653
EventType::ChatModified(_) => 0,
654654
EventType::MsgsChanged { msg_id, .. }
@@ -711,7 +711,7 @@ pub unsafe extern "C" fn dc_event_get_data2_str(event: *mut dc_event_t) -> *mut
711711
| EventType::SelfavatarChanged
712712
| EventType::WebxdcStatusUpdate { .. }
713713
| EventType::WebxdcInstanceDeleted { .. }
714-
| EventType::BackgroundFetchCompletedForAllAccounts
714+
| EventType::AccountsBackgroundFetchDone
715715
| EventType::ChatEphemeralTimerModified { .. } => ptr::null_mut(),
716716
EventType::ConfigureProgress { comment, .. } => {
717717
if let Some(comment) = comment {

deltachat-jsonrpc/src/api.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ impl CommandApi {
233233

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

deltachat-jsonrpc/src/api/types/events.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ pub enum EventType {
251251
/// that all events emitted during the background fetch were processed.
252252
///
253253
/// This event is only emitted by the account manager
254-
BackgroundFetchCompletedForAllAccounts,
254+
AccountsBackgroundFetchDone,
255255
}
256256

257257
impl From<CoreEventType> for EventType {
@@ -360,9 +360,7 @@ impl From<CoreEventType> for EventType {
360360
CoreEventType::WebxdcInstanceDeleted { msg_id } => WebxdcInstanceDeleted {
361361
msg_id: msg_id.to_u32(),
362362
},
363-
CoreEventType::BackgroundFetchCompletedForAllAccounts => {
364-
BackgroundFetchCompletedForAllAccounts
365-
}
363+
CoreEventType::AccountsBackgroundFetchDone => AccountsBackgroundFetchDone,
366364
}
367365
}
368366
}

src/accounts.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ impl Accounts {
296296
///
297297
/// If you need a timeout, then use [Accounts::background_fetch_with_timeout] instead.
298298
///
299-
/// The `BackgroundFetchCompletedForAllAccounts` event is emitted at the end,
299+
/// The `AccountsBackgroundFetchDone` event is emitted at the end,
300300
/// process all events until you get this one and you can safely return to the background
301301
/// without forgeting to create notifications caused by timing race conditions.
302302
pub async fn background_fetch(&self) {
@@ -314,19 +314,19 @@ impl Accounts {
314314
)
315315
.await;
316316

317-
self.emit_event(EventType::BackgroundFetchCompletedForAllAccounts);
317+
self.emit_event(EventType::AccountsBackgroundFetchDone);
318318
}
319319

320320
/// Performs a background fetch for all accounts in parallel with a timeout.
321321
///
322322
/// If you want no timeout, then use [Accounts::background_fetch] instead.
323323
///
324-
/// The `BackgroundFetchCompletedForAllAccounts` event is emitted at the end,
324+
/// The `AccountsBackgroundFetchDone` event is emitted at the end,
325325
/// process all events until you get this one and you can safely return to the background
326326
/// without forgeting to create notifications caused by timing race conditions.
327327
pub async fn background_fetch_with_timeout(&self, timeout: std::time::Duration) -> Result<()> {
328328
let result = tokio::time::timeout(timeout, self.background_fetch()).await;
329-
self.emit_event(EventType::BackgroundFetchCompletedForAllAccounts);
329+
self.emit_event(EventType::AccountsBackgroundFetchDone);
330330
result.map_err(|err| err.into())
331331
}
332332

src/events/payload.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,5 +293,5 @@ pub enum EventType {
293293
/// that all events emitted during the background fetch were processed.
294294
///
295295
/// This event is only emitted by the account manager
296-
BackgroundFetchCompletedForAllAccounts,
296+
AccountsBackgroundFetchDone,
297297
}

0 commit comments

Comments
 (0)