Clean up old messages, better handle errors from sending
This commit is contained in:
parent
bf63c7cc13
commit
727925a266
10 changed files with 232 additions and 66 deletions
|
@ -74,14 +74,26 @@
|
|||
}
|
||||
|
||||
const readBy = message.get('read_by') || [];
|
||||
const expirationStartTimestamp = message.get(
|
||||
'expirationStartTimestamp'
|
||||
);
|
||||
|
||||
readBy.push(receipt.get('reader'));
|
||||
|
||||
message.set({ read_by: readBy });
|
||||
|
||||
await window.Signal.Data.saveMessage(message.attributes, {
|
||||
Message: Whisper.Message,
|
||||
message.set({
|
||||
read_by: readBy,
|
||||
expirationStartTimestamp: expirationStartTimestamp || Date.now(),
|
||||
sent: true,
|
||||
});
|
||||
|
||||
if (message.isExpiring() && !expirationStartTimestamp) {
|
||||
// This will save the message for us while starting the timer
|
||||
await message.setToExpire();
|
||||
} else {
|
||||
await window.Signal.Data.saveMessage(message.attributes, {
|
||||
Message: Whisper.Message,
|
||||
});
|
||||
}
|
||||
|
||||
// notify frontend listeners
|
||||
const conversation = ConversationController.get(
|
||||
message.get('conversationId')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue