Page MenuHomePhabricator

D6933.diff
No OneTemporary

D6933.diff

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

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)

Event Timeline