mirror of
https://github.com/chatmail/core.git
synced 2026-04-22 16:06:30 +03:00
feat: add href to IncomingWebxdcNotify event (#6266)
this PR adds the `href` from `update.href` to the IncomingWebxdcNotify event (DC_EVENT_INCOMING_WEBXDC_NOTIFY in cffi) purpose is to add a "Start" button to the notifications that allow starting the app immediately with the given href
This commit is contained in:
@@ -117,6 +117,9 @@ pub enum EventType {
|
||||
|
||||
/// Text to notify.
|
||||
text: String,
|
||||
|
||||
/// Link assigned to this notification, if any.
|
||||
href: Option<String>,
|
||||
},
|
||||
|
||||
/// There is a fresh message. Typically, the user will show an notification
|
||||
|
||||
@@ -393,7 +393,7 @@ impl Context {
|
||||
.await?;
|
||||
}
|
||||
|
||||
if let Some(href) = status_update_item.href {
|
||||
if let Some(ref href) = status_update_item.href {
|
||||
let mut notify_msg = Message::load_from_db(self, notify_msg_id).await?;
|
||||
notify_msg.param.set(Param::Arg, href);
|
||||
notify_msg.update_param(self).await?;
|
||||
@@ -421,12 +421,14 @@ impl Context {
|
||||
contact_id: from_id,
|
||||
msg_id: notify_msg_id,
|
||||
text: notify_text.clone(),
|
||||
href: status_update_item.href,
|
||||
});
|
||||
} else if let Some(notify_text) = notify_list.get("*") {
|
||||
self.emit_event(EventType::IncomingWebxdcNotify {
|
||||
contact_id: from_id,
|
||||
msg_id: notify_msg_id,
|
||||
text: notify_text.clone(),
|
||||
href: status_update_item.href,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user