Page MenuHomePhabricator

D12634.id41873.diff
No OneTemporary

D12634.id41873.diff

diff --git a/keyserver/src/push/send.js b/keyserver/src/push/send.js
--- a/keyserver/src/push/send.js
+++ b/keyserver/src/push/send.js
@@ -375,6 +375,7 @@
newRawMessageInfos: shimmedNewRawMessageInfos,
threadID: threadInfo.id,
collapseKey: notifInfo.collapseKey,
+ badgeOnly,
unreadCount,
platformDetails,
dbID,
@@ -905,6 +906,7 @@
+newRawMessageInfos: RawMessageInfo[],
+threadID: string,
+collapseKey: ?string,
+ +badgeOnly: boolean,
+unreadCount: number,
+platformDetails: PlatformDetails,
};
@@ -915,27 +917,18 @@
newRawMessageInfos: t.list(rawMessageInfoValidator),
threadID: tID,
collapseKey: t.maybe(t.String),
+ badgeOnly: t.Boolean,
unreadCount: t.Number,
platformDetails: tPlatformDetails,
});
-type APNsNotifInputData = {
- ...CommonNativeNotifInputData,
- +badgeOnly: boolean,
-};
-
-const apnsNotifInputDataValidator = tShape<APNsNotifInputData>({
- ...commonNativeNotifInputDataValidator.meta.props,
- badgeOnly: t.Boolean,
-});
-
async function prepareAPNsNotification(
- inputData: APNsNotifInputData,
+ inputData: CommonNativeNotifInputData,
devices: $ReadOnlyArray<NotificationTargetDevice>,
): Promise<$ReadOnlyArray<TargetedAPNsNotification>> {
const convertedData = await validateOutput(
inputData.platformDetails,
- apnsNotifInputDataValidator,
+ commonNativeNotifInputDataValidator,
inputData,
);
const {
@@ -1183,6 +1176,7 @@
newRawMessageInfos,
threadID,
collapseKey,
+ badgeOnly,
unreadCount,
platformDetails,
dbID,
@@ -1231,7 +1225,7 @@
notification.data = {
...notification.data,
id: notifID,
- badgeOnly: '0',
+ badgeOnly: badgeOnly ? '1' : '0',
};
const messageInfos = JSON.stringify(newRawMessageInfos);

File Metadata

Mime Type
text/plain
Expires
Sun, Oct 6, 2:27 AM (20 h, 12 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2246988
Default Alt Text
D12634.id41873.diff (1 KB)

Event Timeline