add method for desktop to get notification relevant information for a message (#3614)

* add method for desktop to get notification relevant information for a message

* add pr number to changelog

* rename MessageNotificationData to MessageNotificationInfo
This commit is contained in:
Simon Laux
2022-09-25 21:29:46 +02:00
committed by GitHub
parent 17276179e7
commit 9a9c91e591
5 changed files with 88 additions and 2 deletions

View File

@@ -39,7 +39,7 @@ use types::webxdc::WebxdcMessageInfo;
use self::types::{
chat::{BasicChat, MuteDuration},
message::MessageViewtype,
message::{MessageNotificationInfo, MessageViewtype},
};
#[derive(Clone, Debug)]
@@ -642,6 +642,16 @@ impl CommandApi {
Ok(messages)
}
/// Fetch info desktop needs for creating a notification for a message
async fn message_get_notification_info(
&self,
account_id: u32,
message_id: u32,
) -> Result<MessageNotificationInfo> {
let ctx = self.get_context(account_id).await?;
MessageNotificationInfo::from_msg_id(&ctx, MsgId::new(message_id)).await
}
/// Delete messages. The messages are deleted on the current device and
/// on the IMAP server.
async fn delete_messages(&self, account_id: u32, message_ids: Vec<u32>) -> Result<()> {