Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3150775
D6933.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D6933.diff
View Options
diff --git a/keyserver/src/creators/message-creator.js b/keyserver/src/creators/message-creator.js
--- a/keyserver/src/creators/message-creator.js
+++ b/keyserver/src/creators/message-creator.js
@@ -456,21 +456,28 @@
fetchMessageInfoByID(viewer, messageID),
},
);
- return doesGenerateNotif === pushType ? messageInfo : undefined;
+ return doesGenerateNotif === pushType
+ ? { messageInfo, messageData }
+ : undefined;
}),
);
}
- const notifMessageInfos = await Promise.all(promises);
- const filteredNotifMessageInfos = notifMessageInfos.filter(Boolean);
+ const messagesToNotify = await Promise.all(promises);
+ const filteredMessagesToNotify = messagesToNotify.filter(Boolean);
- if (filteredNotifMessageInfos.length === 0) {
+ if (filteredMessagesToNotify.length === 0) {
return undefined;
}
return {
devices: userDevices,
- messageInfos: filteredNotifMessageInfos,
+ messageInfos: filteredMessagesToNotify.map(
+ ({ messageInfo }) => messageInfo,
+ ),
+ messageDatas: filteredMessagesToNotify.map(
+ ({ messageData }) => messageData,
+ ),
};
};
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
@@ -26,6 +26,7 @@
import {
type RawMessageInfo,
type MessageInfo,
+ type MessageData,
messageTypes,
} from 'lib/types/message-types.js';
import type { WebNotification } from 'lib/types/notif-types.js';
@@ -62,7 +63,9 @@
};
type PushUserInfo = {
+devices: Device[],
+ // messageInfos and messageDatas have the same key
+messageInfos: RawMessageInfo[],
+ +messageDatas: MessageData[],
};
type Delivery = PushDelivery | { collapsedInto: string };
type NotificationRow = {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Nov 6, 12:35 AM (21 h, 42 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2427010
Default Alt Text
D6933.diff (1 KB)
Attached To
Mode
D6933: [keyserver] Drill MessageDatas into sendPushNotifs
Attached
Detach File
Event Timeline
Log In to Comment