1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
//! Push support for the Scene data types (draft-atwood-jmap-scene-00
//! §Push Notifications).
//!
//! [`SCENE_DATA_TYPES`] names the four types that take part in the RFC
//! 8620 §7.1 state-change mechanism. A consumer filters each `StateChange`
//! for a subscription with [`jmap_server::state_change_for`], which applies
//! the subscription's `types`, and picks the Web Push `Urgency` header
//! (RFC 8030 §5.3) for it with [`push_urgency`].
//!
//! Coalescing rapid `SceneAvatar` and `SceneObject` mutations (§State-Change
//! Frequency, jmap-chat-spec 77c3474 L2840-2842: the server "MAY coalesce",
//! "for example, 1-5 seconds") needs a clock and a delivery queue, so it is
//! the consumer's job.
use ;
use JmapObject;
/// The Web Push `Urgency` header (RFC 8030 §5.3) that [`push_urgency`]
/// picks; the same type `jmap-web-push` sends.
pub use Urgency;
/// The data types that participate in the state-change mechanism.
///
/// §State-Change Events: "All four Scene data types -- `SceneRegion`,
/// `SceneObject`, `SceneAvatar`, and `SceneAsset` -- participate in the RFC 8620
/// state-change mechanism".
pub const SCENE_DATA_TYPES: & = &;
/// A change, as seen by the user who receives the push, for which
/// §Push Urgency suggests an urgency (jmap-chat-spec 77c3474 L2854: the
/// server "MAY set the `Urgency` header"; "The following urgency
/// assignments are suggested").
///
/// The consumer classifies each change it is about to push; only it knows
/// who receives the push and why the record changed.
/// The urgency for one `StateChange` covering `events`: the highest of
/// their urgencies, or `None` when `events` is empty.
///
/// §Push Urgency: "When a single `StateChange` event covers multiple data
/// types with different recommended urgencies, the server SHOULD use the
/// highest applicable urgency for the combined payload."
///
/// `None` means the draft recommends nothing for the payload. A consumer
/// then omits the header, which RFC 8030 §5.3 treats as `normal`.