typo + only send for webxdcs

This commit is contained in:
Sebastian Klähn
2022-09-11 09:39:56 +02:00
parent 2e2fa95298
commit 70979c55fa
5 changed files with 11 additions and 9 deletions

View File

@@ -304,7 +304,7 @@ pub enum EventType {
},
/// Inform that a message containing a webxdc instance has been deleted
WebXdInstanceDeleted {
WebxdcInstanceDeleted {
msg_id: MsgId,
},
}

View File

@@ -1237,7 +1237,9 @@ pub async fn delete_msgs(context: &Context, msg_ids: &[MsgId]) -> Result<()> {
.await
.with_context(|| format!("Unable to trash message {}", msg_id))?;
context.emit_event(EventType::WebXdInstanceDeleted { msg_id: *msg_id });
if msg.viewtype == Viewtype::Webxdc {
context.emit_event(EventType::WebxdcInstanceDeleted { msg_id: *msg_id });
}
context
.sql

View File

@@ -2387,7 +2387,7 @@ sth_for_the = "future""#
message::delete_msgs(&alice, &[instance.id]).await?;
alice
.evtracker
.get_matching(|evt| matches!(evt, EventType::WebXdInstanceDeleted { .. }))
.get_matching(|evt| matches!(evt, EventType::WebxdcInstanceDeleted { .. }))
.await;
Ok(())
}