Signal send/receive fixes

This commit is contained in:
Darren Clarke 2024-07-31 08:55:19 +02:00
parent c527403868
commit 5e2475848e
3 changed files with 7 additions and 5 deletions

View file

@ -15,11 +15,13 @@ const fetchSignalMessagesTask = async (): Promise<void> => {
const messages = await messagesClient.v1ReceiveNumberGet({ number }); const messages = await messagesClient.v1ReceiveNumberGet({ number });
for (const msg of messages) { for (const msg of messages) {
console.log(msg);
const { envelope } = msg as any; const { envelope } = msg as any;
const { source, sourceUuid, dataMessage } = envelope; const { source, sourceUuid, dataMessage } = envelope;
const messageId = sourceUuid;
const message = dataMessage?.message; const message = dataMessage?.message;
const timestamp = new Date(dataMessage?.timestamp); const rawTimestamp = dataMessage?.timestamp;
const timestamp = new Date(rawTimestamp);
const messageId = `${sourceUuid}-${rawTimestamp}`;
const attachment = undefined; const attachment = undefined;
const mimeType = undefined; const mimeType = undefined;
const filename = undefined; const filename = undefined;

View file

@ -23,7 +23,7 @@ class Channel
# ) # )
# #
def send(options, article, _notification = false) def deliver(options, article, _notification = false)
# return if we run import mode # return if we run import mode
return if Setting.get('import_mode') return if Setting.get('import_mode')

View file

@ -21,8 +21,8 @@ class Channel::Driver::CdrWhatsapp
# ) # )
# #
def send(options, article, _notification = false) def deliver(options, article, _notification = false)
# return if we run import mode # return if we run import mode
return if Setting.get('import_mode') return if Setting.get('import_mode')
options = check_external_credential(options) options = check_external_credential(options)