Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3524467
D12738.id42310.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D12738.id42310.diff
View Options
diff --git a/web/shared-worker/worker/shared-worker.js b/web/shared-worker/worker/shared-worker.js
--- a/web/shared-worker/worker/shared-worker.js
+++ b/web/shared-worker/worker/shared-worker.js
@@ -39,6 +39,7 @@
} from '../../types/worker-types.js';
import { workerIdentityClientRequests } from '../../types/worker-types.js';
import { getDatabaseModule } from '../db-module.js';
+import { webMessageToClientDBMessageInfo } from '../types/entities.js';
import {
COMM_SQLITE_DATABASE_PATH,
SQLITE_STAMPED_USER_ID_KEY,
@@ -252,6 +253,16 @@
type: workerResponseMessageTypes.GET_OUTBOUND_P2P_MESSAGES,
outboundP2PMessages: sqliteQueryExecutor.getAllOutboundP2PMessages(),
};
+ } else if (
+ message.type === workerRequestMessageTypes.GET_RELATED_MESSAGES
+ ) {
+ const webMessageEntities = sqliteQueryExecutor.getRelatedMessagesWeb(
+ message.messageID,
+ );
+ return {
+ type: workerResponseMessageTypes.GET_RELATED_MESSAGES,
+ messages: webMessageEntities.map(webMessageToClientDBMessageInfo),
+ };
}
// write operations
diff --git a/web/types/worker-types.js b/web/types/worker-types.js
--- a/web/types/worker-types.js
+++ b/web/types/worker-types.js
@@ -11,6 +11,7 @@
IdentityServiceClient,
IdentityServiceAuthLayer,
} from 'lib/types/identity-service-types.js';
+import type { ClientDBMessageInfo } from 'lib/types/message-types.js';
import type {
InboundP2PMessage,
OutboundP2PMessage,
@@ -43,6 +44,7 @@
GET_OUTBOUND_P2P_MESSAGES: 18,
MARK_OUTBOUND_P2P_MESSAGE_AS_SENT: 19,
REMOVE_OUTBOUND_P2P_MESSAGES: 20,
+ GET_RELATED_MESSAGES: 21,
});
export const workerWriteRequests: $ReadOnlyArray<number> = [
@@ -188,6 +190,11 @@
+deviceID: string,
};
+export type GetRelatedMessagesRequestMessage = {
+ +type: 21,
+ +messageID: string,
+};
+
export type WorkerRequestMessage =
| PingWorkerRequestMessage
| InitWorkerRequestMessage
@@ -209,7 +216,8 @@
| RemoveInboundP2PMessagesRequestMessage
| GetOutboundP2PMessagesRequestMessage
| MarkOutboundP2PMessageAsSentRequestMessage
- | RemoveOutboundP2PMessagesRequestMessage;
+ | RemoveOutboundP2PMessagesRequestMessage
+ | GetRelatedMessagesRequestMessage;
export type WorkerRequestProxyMessage = {
+id: number,
@@ -226,6 +234,7 @@
CALL_OLM_API_METHOD: 5,
GET_INBOUND_P2P_MESSAGES: 6,
GET_OUTBOUND_P2P_MESSAGES: 7,
+ GET_RELATED_MESSAGES: 8,
});
export type PongWorkerResponseMessage = {
@@ -268,6 +277,11 @@
+outboundP2PMessages: $ReadOnlyArray<OutboundP2PMessage>,
};
+export type GetRelatedMessagesResponseMessage = {
+ +type: 8,
+ +messages: $ReadOnlyArray<ClientDBMessageInfo>,
+};
+
export type WorkerResponseMessage =
| PongWorkerResponseMessage
| ClientStoreResponseMessage
@@ -276,7 +290,8 @@
| CallIdentityClientMethodResponseMessage
| CallOLMApiMethodResponseMessage
| GetInboundP2PMessagesResponseMessage
- | GetOutboundP2PMessagesResponseMessage;
+ | GetOutboundP2PMessagesResponseMessage
+ | GetRelatedMessagesResponseMessage;
export type WorkerResponseProxyMessage = {
+id?: number,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Dec 24, 12:40 PM (4 h, 18 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2700042
Default Alt Text
D12738.id42310.diff (3 KB)
Attached To
Mode
D12738: [web] Introduce getRelatedMessages to shared worker
Attached
Detach File
Event Timeline
Log In to Comment