diff --git a/CHANGELOG.md b/CHANGELOG.md index 441f7a8b2..2fdeab251 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -60,8 +60,6 @@ - Document accounts manager #3837 - If a classical-email-user sends an email to a group and adds new recipients, add the new recipients as group members #3781 - -### API-Changes - Remove `pytest-async` plugin #3846 - Only send the message about ephemeral timer change if the chat is promoted #3847 - Use relative paths in `accounts.toml` #3838 diff --git a/deltachat-ffi/deltachat.h b/deltachat-ffi/deltachat.h index ba60ee99d..8d8b3d412 100644 --- a/deltachat-ffi/deltachat.h +++ b/deltachat-ffi/deltachat.h @@ -1088,7 +1088,7 @@ char* dc_get_webxdc_status_updates (dc_context_t* context, uint32_t msg_id, uint * @param context The context object. * @param msg_id The ID of the message with the webxdc instance. - * @return 1=contact ID is member of chat ID, 0=contact is not in chat + * @return 1 = webxdc is updating , 0 = webxdc is not updating */ int dc_is_webxdc_updating (dc_context_t* context, uint32_t msg_id); @@ -5892,7 +5892,7 @@ void dc_event_unref(dc_event_t* event); * @param data1 (int) msg_id * @param data1 (int) is_sending */ -#define DC_EVENT_WEBXDC_UPDATE_STATE_CHANGED 2017 +#define DC_EVENT_WEBXDC_UPDATE_STATE_CHANGED 2122 /** * @} diff --git a/deltachat-ffi/src/lib.rs b/deltachat-ffi/src/lib.rs index 877ac2393..11357fff2 100644 --- a/deltachat-ffi/src/lib.rs +++ b/deltachat-ffi/src/lib.rs @@ -521,7 +521,7 @@ pub unsafe extern "C" fn dc_event_get_id(event: *mut dc_event_t) -> libc::c_int EventType::SelfavatarChanged => 2110, EventType::WebxdcStatusUpdate { .. } => 2120, EventType::WebxdcInstanceDeleted { .. } => 2121, - EventType::WebxdcUpdateStateChanged { .. } => 2017, + EventType::WebxdcUpdateStateChanged { .. } => 2122, } } @@ -621,7 +621,7 @@ pub unsafe extern "C" fn dc_event_get_data2_int(event: *mut dc_event_t) -> libc: .. } => status_update_serial.to_u32() as libc::c_int, EventType::WebxdcUpdateStateChanged { - is_sending: is_send, + has_pending_updates: is_send, .. } => *is_send as libc::c_int, } diff --git a/src/events.rs b/src/events.rs index 1341b637b..601fc6f7c 100644 --- a/src/events.rs +++ b/src/events.rs @@ -324,6 +324,6 @@ pub enum EventType { /// Informs that the webxdc changed its update sending state WebxdcUpdateStateChanged { msg_id: MsgId, - is_sending: bool, + has_pending_updates: bool, }, } diff --git a/src/smtp.rs b/src/smtp.rs index de20f90e1..b3669e690 100644 --- a/src/smtp.rs +++ b/src/smtp.rs @@ -21,7 +21,6 @@ use crate::oauth2::get_oauth2_access_token; use crate::provider::Socket; use crate::socks::Socks5Config; use crate::sql; - use crate::{context::Context, scheduler::connectivity::ConnectivityStore}; /// SMTP write and read timeout in seconds. diff --git a/src/webxdc.rs b/src/webxdc.rs index 0433ab15c..0dbbfa0b6 100644 --- a/src/webxdc.rs +++ b/src/webxdc.rs @@ -405,11 +405,6 @@ impl Context { ) .await?; - self.emit_event(EventType::WebxdcUpdateStateChanged { - msg_id: instance.id, - is_sending: true, - }); - if send_now { self.sql.insert( "INSERT INTO smtp_status_updates (msg_id, first_serial, last_serial, descr) VALUES(?, ?, ?, ?) @@ -417,6 +412,12 @@ impl Context { DO UPDATE SET last_serial=excluded.last_serial, descr=excluded.descr", paramsv![instance.id, status_update_serial, status_update_serial, descr], ).await?; + + self.emit_event(EventType::WebxdcUpdateStateChanged { + msg_id: instance.id, + has_pending_updates: true, + }); + self.interrupt_smtp(InterruptInfo::new(false)).await; } Ok(()) @@ -477,7 +478,7 @@ impl Context { for msg_id in update_needed.difference(&update_needed_after_sending) { self.emit_event(EventType::WebxdcUpdateStateChanged { msg_id: *msg_id, - is_sending: false, + has_pending_updates: false, }) } Ok(()) @@ -2456,7 +2457,7 @@ sth_for_the = "future""# matches!( evt, EventType::WebxdcUpdateStateChanged { - is_sending: true, + has_pending_updates: true, .. } ) @@ -2471,7 +2472,7 @@ sth_for_the = "future""# matches!( evt, EventType::WebxdcUpdateStateChanged { - is_sending: false, + has_pending_updates: false, .. } )