Standardize bridge send/receive params

This commit is contained in:
Darren Clarke 2024-07-18 11:08:01 +02:00
parent 69abe9bee1
commit c32c26088f
23 changed files with 7042 additions and 1276 deletions

View file

@ -17,16 +17,23 @@ const fetchSignalMessagesTask = async (): Promise<void> => {
for (const msg of messages) {
const { envelope } = msg as any;
const { source, sourceUuid, dataMessage } = envelope;
const messageID = sourceUuid;
const messageId = sourceUuid;
const message = dataMessage?.message;
const timestamp = new Date(dataMessage?.timestamp);
const attachment = undefined;
const mimeType = undefined;
const filename = undefined;
if (source !== number && message) {
await worker.addJob("signal/receive-signal-message", {
token: id,
sender: source,
messageID,
to: number,
from: source,
messageId,
message,
timestamp: timestamp.toISOString(),
sentAt: timestamp.toISOString(),
attachment,
filename,
mimeType,
});
}
}