Stories: Proper notifications and handling of out-of-order messages
This commit is contained in:
parent
81fc9ff94d
commit
50a0110192
12 changed files with 425 additions and 274 deletions
|
@ -3,7 +3,10 @@
|
|||
|
||||
import type { AttachmentType } from '../types/Attachment';
|
||||
import type { MessageAttributesType } from '../model-types.d';
|
||||
import type { SendStateByConversationId } from '../messages/MessageSendState';
|
||||
import type {
|
||||
SendState,
|
||||
SendStateByConversationId,
|
||||
} from '../messages/MessageSendState';
|
||||
import type { UUIDStringType } from '../types/UUID';
|
||||
import * as log from '../logging/log';
|
||||
import dataInterface from '../sql/Client';
|
||||
|
@ -261,27 +264,29 @@ export async function sendStoryMessage(
|
|||
const groupTimestamp = timestamp + index + 1;
|
||||
|
||||
const myId = window.ConversationController.getOurConversationIdOrThrow();
|
||||
const sendState = {
|
||||
const sendState: SendState = {
|
||||
status: SendStatus.Pending,
|
||||
updatedAt: groupTimestamp,
|
||||
isAllowedToReplyToStory: true,
|
||||
};
|
||||
|
||||
const sendStateByConversationId = getRecipients(group.attributes).reduce(
|
||||
(acc, id) => {
|
||||
const conversation = window.ConversationController.get(id);
|
||||
if (!conversation) {
|
||||
return acc;
|
||||
}
|
||||
const sendStateByConversationId: SendStateByConversationId =
|
||||
getRecipients(group.attributes).reduce(
|
||||
(acc, id) => {
|
||||
const conversation = window.ConversationController.get(id);
|
||||
if (!conversation) {
|
||||
return acc;
|
||||
}
|
||||
|
||||
return {
|
||||
...acc,
|
||||
[conversation.id]: sendState,
|
||||
};
|
||||
},
|
||||
{
|
||||
[myId]: sendState,
|
||||
}
|
||||
);
|
||||
return {
|
||||
...acc,
|
||||
[conversation.id]: sendState,
|
||||
};
|
||||
},
|
||||
{
|
||||
[myId]: sendState,
|
||||
}
|
||||
);
|
||||
|
||||
const messageAttributes =
|
||||
await window.Signal.Migrations.upgradeMessageSchema({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue