Page MenuHomePhabricator

D12895.id42833.diff
No OneTemporary

D12895.id42833.diff

diff --git a/lib/types/tunnelbroker/notif-types.js b/lib/types/tunnelbroker/notif-types.js
--- a/lib/types/tunnelbroker/notif-types.js
+++ b/lib/types/tunnelbroker/notif-types.js
@@ -15,3 +15,15 @@
+data: string,
+priority: 'NORMAL' | 'HIGH',
};
+
+export type TunnelbrokerWebPushNotif = {
+ +type: 'WebPushNotif',
+ +clientMessageID: string,
+ +deviceID: string,
+ +payload: string,
+};
+
+export type TunnelbrokerNotif =
+ | TunnelbrokerAPNsNotif
+ | TunnelbrokerFCMNotif
+ | TunnelbrokerWebPushNotif;
diff --git a/shared/tunnelbroker_messages/src/messages/mod.rs b/shared/tunnelbroker_messages/src/messages/mod.rs
--- a/shared/tunnelbroker_messages/src/messages/mod.rs
+++ b/shared/tunnelbroker_messages/src/messages/mod.rs
@@ -43,6 +43,7 @@
AnonymousInitializationMessage(AnonymousInitializationMessage),
APNsNotif(APNsNotif),
FCMNotif(FCMNotif),
+ WebPushNotif(WebPushNotif),
MessageToDeviceRequest(MessageToDeviceRequest),
MessageReceiveConfirmation(MessageReceiveConfirmation),
MessageToTunnelbrokerRequest(MessageToTunnelbrokerRequest),
diff --git a/shared/tunnelbroker_messages/src/messages/notif.rs b/shared/tunnelbroker_messages/src/messages/notif.rs
--- a/shared/tunnelbroker_messages/src/messages/notif.rs
+++ b/shared/tunnelbroker_messages/src/messages/notif.rs
@@ -23,3 +23,14 @@
pub data: String,
pub priority: String,
}
+
+/// WebPush notif built on client.
+#[derive(Serialize, Deserialize, PartialEq, Debug)]
+#[serde(tag = "type", rename_all = "camelCase")]
+pub struct WebPushNotif {
+ #[serde(rename = "clientMessageID")]
+ pub client_message_id: String,
+ #[serde(rename = "deviceID")]
+ pub device_id: String,
+ pub payload: String,
+}

File Metadata

Mime Type
text/plain
Expires
Sat, Nov 30, 4:47 AM (19 h, 19 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2599608
Default Alt Text
D12895.id42833.diff (1 KB)

Event Timeline