Skip to content

Commit

Permalink
Merge pull request #17 from de-nets/FixWAimport
Browse files Browse the repository at this point in the history
Fix WhatsApp DB import
  • Loading branch information
tlueder authored Dec 11, 2023
2 parents be99b15 + 91f6e74 commit 3866b33
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 12 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 1.2.1

- Fixed some messages are not shown after WhatsApp import from DB

## 1.2.0

- Added WhatsApp import from DB
Expand Down
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
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: move_to_signal
description: Import messages from other apps like WhatsApp to Signal.
version: 1.2.0
version: 1.2.1
repository: https://github.com/de-nets/MoveToSignal

environment:
Expand Down

0 comments on commit 3866b33

Please sign in to comment.