Push subscription improvements + CalendarAlert implementation (closes #1248)
This commit is contained in:
@@ -379,6 +379,24 @@ impl BatchBuilder {
|
||||
self
|
||||
}
|
||||
|
||||
pub fn log_share_notification(
|
||||
&mut self,
|
||||
notification_id: u64,
|
||||
notify_account_id: u32,
|
||||
value: impl SerializeInfallible,
|
||||
) -> &mut Self {
|
||||
self.changed_collections
|
||||
.get_mut_or_insert(notify_account_id)
|
||||
.share_notification_id = Some(notification_id);
|
||||
self.set(
|
||||
ValueClass::ShareNotification {
|
||||
notification_id,
|
||||
notify_account_id,
|
||||
},
|
||||
value.serialize(),
|
||||
)
|
||||
}
|
||||
|
||||
fn serialize_changes(&mut self) {
|
||||
if !self.changes.is_empty() {
|
||||
for (account_id, changelog) in std::mem::take(&mut self.changes) {
|
||||
|
||||
@@ -302,10 +302,11 @@ impl ValueClass {
|
||||
due,
|
||||
event_id,
|
||||
alarm_id,
|
||||
is_email_alert,
|
||||
} => serializer
|
||||
.write(*due)
|
||||
.write(account_id)
|
||||
.write(3u8)
|
||||
.write(if *is_email_alert { 3u8 } else { 6u8 })
|
||||
.write(document_id)
|
||||
.write(*event_id)
|
||||
.write(*alarm_id),
|
||||
|
||||
@@ -119,6 +119,7 @@ pub struct BatchBuilder {
|
||||
pub struct ChangedCollection {
|
||||
pub changed_containers: Bitmap<SyncCollection>,
|
||||
pub changed_items: Bitmap<SyncCollection>,
|
||||
pub share_notification_id: Option<u64>,
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq, Eq, Hash)]
|
||||
@@ -217,6 +218,7 @@ pub enum TaskQueueClass {
|
||||
due: u64,
|
||||
event_id: u16,
|
||||
alarm_id: u16,
|
||||
is_email_alert: bool,
|
||||
},
|
||||
SendImip {
|
||||
due: u64,
|
||||
|
||||
Reference in New Issue
Block a user