mirror of
https://github.com/chatmail/core.git
synced 2026-10-02 03:00:40 +03:00
api!: remove getPushState() and core's internal tracking of it.
Since https://github.com/deltachat/deltachat-ios/pull/3224 pushstate is not used (android, desktop etc. never used it, only ios)
This commit is contained in:
-25
@@ -7,14 +7,12 @@
|
||||
//! which holds push notification token for the device,
|
||||
//! shared by all accounts.
|
||||
use std::sync::Arc;
|
||||
use std::sync::atomic::Ordering;
|
||||
|
||||
use anyhow::{Context as _, Result};
|
||||
use base64::Engine as _;
|
||||
use pgp::crypto::aead::{AeadAlgorithm, ChunkSize};
|
||||
use pgp::crypto::sym::SymmetricKeyAlgorithm;
|
||||
|
||||
use crate::context::Context;
|
||||
use crate::key::DcKey;
|
||||
|
||||
/// Manages subscription to Apple Push Notification services.
|
||||
@@ -117,29 +115,6 @@ impl PushSubscriber {
|
||||
}
|
||||
}
|
||||
|
||||
/// Push notification state
|
||||
#[derive(Debug, Default, Clone, Copy, PartialEq, Eq, FromPrimitive, ToPrimitive)]
|
||||
#[repr(i8)]
|
||||
pub enum NotifyState {
|
||||
/// Not subscribed to push notifications.
|
||||
#[default]
|
||||
NotConnected = 0,
|
||||
|
||||
/// Subscribed to push notifications for new messages.
|
||||
Connected = 2,
|
||||
}
|
||||
|
||||
impl Context {
|
||||
/// Returns push notification subscriber state.
|
||||
pub fn push_state(&self) -> NotifyState {
|
||||
if self.push_subscribed.load(Ordering::Relaxed) {
|
||||
NotifyState::Connected
|
||||
} else {
|
||||
NotifyState::NotConnected
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
Reference in New Issue
Block a user