Skip to content

Commit

Permalink
Use preset and override if valid
Browse files Browse the repository at this point in the history
  • Loading branch information
tlueder committed Dec 11, 2023
1 parent be99b15 commit ce6b9f1
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions lib/source/whats_app_db.dart
Original file line number Diff line number Diff line change
Expand Up @@ -269,23 +269,25 @@ class WhatsAppDb extends Signal {
signalMessage.fromRecipientId = signalUserID;
signalMessage.toRecipientId = contactSignalId;
signalMessage.setSend();
signalMessage.dateSent = message['timestamp'];
signalMessage.dateReceived = message['receivedTimestamp'];
signalMessage.receiptTimestamp = message['receiptServerTimestamp'];
if (message['receivedTimestamp'] != 0) {
signalMessage.dateReceived = message['receivedTimestamp'];
}
if (message['receiptServerTimestamp'] != 0) {
signalMessage.receiptTimestamp = message['receiptServerTimestamp'];
}
} else {
// Message was received

signalMessage.threadId = contactSignalThreadId;
signalMessage.fromRecipientId = contactSignalId;
signalMessage.toRecipientId = signalUserID;

signalMessage.dateSent = message['timestamp'];
signalMessage.dateServer = signalMessage.dateSent! + 500;
signalMessage.dateReceived = message['receivedTimestamp'];
signalMessage.receiptTimestamp = message['receiptServerTimestamp'];
signalMessage.notifiedTimestamp = signalMessage.dateReceived! + 500;
signalMessage.reactionsLastSeen =
signalMessage.notifiedTimestamp + 5000;
signalMessage.setReceived();
if (message['receivedTimestamp'] != 0) {
signalMessage.dateReceived = message['receivedTimestamp'];
}
if (message['receiptServerTimestamp'] != 0) {
signalMessage.receiptTimestamp = message['receiptServerTimestamp'];
}
}

for (final reaction in message['reactions']) {
Expand Down

0 comments on commit ce6b9f1

Please sign in to comment.