mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-02-14 23:18:54 +00:00
Add support for OutgoingMessageDetails.dateReceived
This commit is contained in:
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
@@ -234,7 +234,7 @@ jobs:
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
||||
with:
|
||||
repository: 'signalapp/Signal-Message-Backup-Tests'
|
||||
ref: 'df09e4bfa985c68daf845ad96abae3ae8f9b07ca'
|
||||
ref: '279370b21fd089956a581c3b027489594135998a'
|
||||
path: 'backup-integration-tests'
|
||||
|
||||
- run: xvfb-run --auto-servernum pnpm run test-electron
|
||||
|
||||
@@ -396,6 +396,7 @@ message ChatItem {
|
||||
|
||||
message OutgoingMessageDetails {
|
||||
repeated SendStatus sendStatus = 1;
|
||||
uint64 dateReceived = 2; // may be different from dateSent for sync messages
|
||||
}
|
||||
|
||||
message DirectionlessMessageDetails {
|
||||
|
||||
@@ -2683,9 +2683,15 @@ export class BackupExportStream extends Readable {
|
||||
sendStateByConversationId = {},
|
||||
unidentifiedDeliveries = [],
|
||||
errors = [],
|
||||
received_at_ms: receivedAtMs,
|
||||
editMessageReceivedAtMs,
|
||||
}: Pick<
|
||||
MessageAttributesType,
|
||||
'sendStateByConversationId' | 'unidentifiedDeliveries' | 'errors'
|
||||
| 'sendStateByConversationId'
|
||||
| 'unidentifiedDeliveries'
|
||||
| 'errors'
|
||||
| 'received_at_ms'
|
||||
| 'editMessageReceivedAtMs'
|
||||
>,
|
||||
{ conversationId }: { conversationId: string }
|
||||
): Backups.ChatItem.IOutgoingMessageDetails {
|
||||
@@ -2784,8 +2790,12 @@ export class BackupExportStream extends Readable {
|
||||
|
||||
sendStatuses.push(sendStatus);
|
||||
}
|
||||
|
||||
const dateReceived = editMessageReceivedAtMs || receivedAtMs;
|
||||
return {
|
||||
sendStatus: sendStatuses,
|
||||
dateReceived:
|
||||
dateReceived != null ? getSafeLongFromTimestamp(dateReceived) : null,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -1738,7 +1738,9 @@ export class BackupImportStream extends Writable {
|
||||
return {
|
||||
patch: {
|
||||
sendStateByConversationId,
|
||||
received_at_ms: timestamp,
|
||||
received_at_ms:
|
||||
getCheckedTimestampOrUndefinedFromLong(outgoing.dateReceived) ??
|
||||
timestamp,
|
||||
unidentifiedDeliveries: unidentifiedDeliveries.length
|
||||
? unidentifiedDeliveries
|
||||
: undefined,
|
||||
|
||||
@@ -132,7 +132,7 @@ describe('backup/bubble messages', () => {
|
||||
type: 'outgoing',
|
||||
readStatus: ReadStatus.Read,
|
||||
received_at: 3,
|
||||
received_at_ms: 3,
|
||||
received_at_ms: 43,
|
||||
seenStatus: SeenStatus.Seen,
|
||||
sent_at: 3,
|
||||
sourceServiceId: OUR_ACI,
|
||||
@@ -144,14 +144,14 @@ describe('backup/bubble messages', () => {
|
||||
unidentifiedDeliveries: [CONTACT_A],
|
||||
timestamp: 3,
|
||||
editMessageTimestamp: 5,
|
||||
editMessageReceivedAtMs: 5,
|
||||
editMessageReceivedAtMs: 45,
|
||||
body: 'd',
|
||||
editHistory: [
|
||||
{
|
||||
body: 'd',
|
||||
timestamp: 5,
|
||||
received_at: 5,
|
||||
received_at_ms: 5,
|
||||
received_at_ms: 45,
|
||||
sendStateByConversationId: {
|
||||
[contactA.id]: {
|
||||
status: SendStatus.Delivered,
|
||||
@@ -162,7 +162,7 @@ describe('backup/bubble messages', () => {
|
||||
body: 'c',
|
||||
timestamp: 4,
|
||||
received_at: 4,
|
||||
received_at_ms: 4,
|
||||
received_at_ms: 44,
|
||||
sendStateByConversationId: {
|
||||
[contactA.id]: {
|
||||
status: SendStatus.Viewed,
|
||||
@@ -173,7 +173,7 @@ describe('backup/bubble messages', () => {
|
||||
body: 'b',
|
||||
timestamp: 3,
|
||||
received_at: 3,
|
||||
received_at_ms: 3,
|
||||
received_at_ms: 43,
|
||||
sendStateByConversationId: {
|
||||
[contactA.id]: {
|
||||
status: SendStatus.Viewed,
|
||||
@@ -468,7 +468,7 @@ describe('backup/bubble messages', () => {
|
||||
id: generateGuid(),
|
||||
type: 'outgoing',
|
||||
received_at: 3,
|
||||
received_at_ms: 3,
|
||||
received_at_ms: 4,
|
||||
sent_at: 3,
|
||||
sourceServiceId: OUR_ACI,
|
||||
sendStateByConversationId: {
|
||||
|
||||
Reference in New Issue
Block a user