mirror of
https://github.com/chatmail/core.git
synced 2026-04-17 21:46:35 +03:00
api: dc_accounts_set_push_device_token and dc_get_push_state APIs
This commit is contained in:
@@ -25,6 +25,13 @@ pub(crate) struct Capabilities {
|
||||
/// <https://tools.ietf.org/html/rfc5464>
|
||||
pub can_metadata: bool,
|
||||
|
||||
/// True if the server supports XDELTAPUSH capability.
|
||||
/// This capability means setting /private/devicetoken IMAP METADATA
|
||||
/// on the INBOX results in new mail notifications
|
||||
/// via notifications.delta.chat service.
|
||||
/// This is supported by <https://github.com/deltachat/chatmail>
|
||||
pub can_push: bool,
|
||||
|
||||
/// Server ID if the server supports ID capability.
|
||||
pub server_id: Option<HashMap<String, String>>,
|
||||
}
|
||||
|
||||
@@ -60,6 +60,7 @@ async fn determine_capabilities(
|
||||
can_check_quota: caps.has_str("QUOTA"),
|
||||
can_condstore: caps.has_str("CONDSTORE"),
|
||||
can_metadata: caps.has_str("METADATA"),
|
||||
can_push: caps.has_str("XDELTAPUSH"),
|
||||
server_id,
|
||||
};
|
||||
Ok(capabilities)
|
||||
|
||||
@@ -90,6 +90,10 @@ impl Session {
|
||||
self.capabilities.can_metadata
|
||||
}
|
||||
|
||||
pub fn can_push(&self) -> bool {
|
||||
self.capabilities.can_push
|
||||
}
|
||||
|
||||
/// Returns the names of all folders on the IMAP server.
|
||||
pub async fn list_folders(&mut self) -> Result<Vec<async_imap::types::Name>> {
|
||||
let list = self.list(Some(""), Some("*")).await?.try_collect().await?;
|
||||
|
||||
Reference in New Issue
Block a user