Skip to content

Commit

Permalink
Fix forwarded messages timestamp offset
Browse files Browse the repository at this point in the history
  • Loading branch information
jamiebuilds-signal committed Apr 3, 2023
1 parent 2710f46 commit 4e6c3ba
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions ts/util/maybeForwardMessages.ts
Expand Up @@ -142,6 +142,8 @@ export async function maybeForwardMessages(
loadStickerData,
} = window.Signal.Migrations;

let timestampOffset = 0;

// load any sticker data, attachments, or link previews that we need to
// send along with the message and do the send to each conversation.
const preparedMessages = await Promise.all(
Expand Down Expand Up @@ -228,12 +230,15 @@ export async function maybeForwardMessages(
);

// Actually send the messages
conversations.forEach((conversation, offset) => {
conversations.forEach(conversation => {
if (conversation == null) {
return;
}
const timestamp = baseTimestamp + offset;

sortedMessages.forEach(entry => {
const timestamp = baseTimestamp + timestampOffset;
timestampOffset += 1;

const { enqueuedMessage, originalMessage } = entry;
drop(
conversation
Expand Down

0 comments on commit 4e6c3ba

Please sign in to comment.