Group stories should have a different timestamp

This commit is contained in:
Josh Perez 2022-08-19 17:12:05 -04:00 committed by GitHub
parent f7f65de322
commit 70bdbe33d5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 6 deletions

View file

@ -170,7 +170,7 @@ export async function sendStoryMessage(
>();
await Promise.all(
conversationIds.map(async conversationId => {
conversationIds.map(async (conversationId, index) => {
const group = window.ConversationController.get(conversationId);
if (!group) {
@ -189,10 +189,12 @@ export async function sendStoryMessage(
return;
}
const groupTimestamp = timestamp + index;
const myId = window.ConversationController.getOurConversationIdOrThrow();
const sendState = {
status: SendStatus.Pending,
updatedAt: timestamp,
updatedAt: groupTimestamp,
};
const sendStateByConversationId = getRecipients(group.attributes).reduce(
@ -220,13 +222,13 @@ export async function sendStoryMessage(
id: UUID.generate().toString(),
readStatus: ReadStatus.Read,
received_at: incrementMessageCounter(),
received_at_ms: timestamp,
received_at_ms: groupTimestamp,
seenStatus: SeenStatus.NotApplicable,
sendStateByConversationId,
sent_at: timestamp,
sent_at: groupTimestamp,
source: window.textsecure.storage.user.getNumber(),
sourceUuid: window.textsecure.storage.user.getUuid()?.toString(),
timestamp,
timestamp: groupTimestamp,
type: 'story',
});