Fix types when creating ephemeral messages for DOE and reactions
This commit is contained in:
parent
f87a3a2cb7
commit
dc78165043
1 changed files with 12 additions and 22 deletions
|
@ -3184,7 +3184,9 @@ export class ConversationModel extends window.Backbone
|
||||||
timestamp
|
timestamp
|
||||||
);
|
);
|
||||||
|
|
||||||
const attributes = ({
|
// We are only creating this model so we can use its sync message
|
||||||
|
// sending functionality. It will not be saved to the database.
|
||||||
|
const message = new window.Whisper.Message({
|
||||||
id: window.getGuid(),
|
id: window.getGuid(),
|
||||||
type: 'outgoing',
|
type: 'outgoing',
|
||||||
conversationId: this.get('id'),
|
conversationId: this.get('id'),
|
||||||
|
@ -3193,16 +3195,9 @@ export class ConversationModel extends window.Backbone
|
||||||
received_at_ms: timestamp,
|
received_at_ms: timestamp,
|
||||||
recipients,
|
recipients,
|
||||||
deletedForEveryoneTimestamp: targetTimestamp,
|
deletedForEveryoneTimestamp: targetTimestamp,
|
||||||
// TODO: DESKTOP-722
|
timestamp,
|
||||||
} as unknown) as typeof window.Whisper.MessageAttributesType;
|
...(isDirectConversation(this.attributes) ? { destination } : {}),
|
||||||
|
});
|
||||||
if (isDirectConversation(this.attributes)) {
|
|
||||||
attributes.destination = destination;
|
|
||||||
}
|
|
||||||
|
|
||||||
// We are only creating this model so we can use its sync message
|
|
||||||
// sending functionality. It will not be saved to the database.
|
|
||||||
const message = new window.Whisper.Message(attributes);
|
|
||||||
|
|
||||||
// We're offline!
|
// We're offline!
|
||||||
if (!window.textsecure.messaging) {
|
if (!window.textsecure.messaging) {
|
||||||
|
@ -3318,7 +3313,9 @@ export class ConversationModel extends window.Backbone
|
||||||
|
|
||||||
const expireTimer = this.get('expireTimer');
|
const expireTimer = this.get('expireTimer');
|
||||||
|
|
||||||
const attributes = ({
|
// We are only creating this model so we can use its sync message
|
||||||
|
// sending functionality. It will not be saved to the database.
|
||||||
|
const message = new window.Whisper.Message({
|
||||||
id: window.getGuid(),
|
id: window.getGuid(),
|
||||||
type: 'outgoing',
|
type: 'outgoing',
|
||||||
conversationId: this.get('id'),
|
conversationId: this.get('id'),
|
||||||
|
@ -3327,16 +3324,9 @@ export class ConversationModel extends window.Backbone
|
||||||
received_at_ms: timestamp,
|
received_at_ms: timestamp,
|
||||||
recipients,
|
recipients,
|
||||||
reaction: outgoingReaction,
|
reaction: outgoingReaction,
|
||||||
// TODO: DESKTOP-722
|
timestamp,
|
||||||
} as unknown) as typeof window.Whisper.MessageAttributesType;
|
...(isDirectConversation(this.attributes) ? { destination } : {}),
|
||||||
|
});
|
||||||
if (isDirectConversation(this.attributes)) {
|
|
||||||
attributes.destination = destination;
|
|
||||||
}
|
|
||||||
|
|
||||||
// We are only creating this model so we can use its sync message
|
|
||||||
// sending functionality. It will not be saved to the database.
|
|
||||||
const message = new window.Whisper.Message(attributes);
|
|
||||||
|
|
||||||
// This is to ensure that the functions in send() and sendSyncMessage() don't save
|
// This is to ensure that the functions in send() and sendSyncMessage() don't save
|
||||||
// anything to the database.
|
// anything to the database.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue