@ -783,6 +780,7 @@ export class ConversationModel extends Backbone.Model<ConversationAttributes> {
lastMessageStatus:'sending',
active_at: networkTimestamp,
});
awaitthis.commit();
voidthis.queueJob(async()=>{
@ -853,13 +851,16 @@ export class ConversationModel extends Backbone.Model<ConversationAttributes> {
}
// NOTE: We don' mind if the message is the same, we still want to update the conversation because we want to show visible control messages we receive an ExpirationTimerUpdate
// Even though this isn't reflected to the user, we want to place the last seen
// indicator above it. We set it to 'unread' to trigger that placement.
unread: READ_MESSAGE_STATE.unread,
source,
sent_at: timestamp,
received_at: timestamp,
});
}
if(!message){
if(isOutgoing){
message=awaitthis.addSingleOutgoingMessage({
...commonAttributes,
sent_at: timestamp,
});
}else{
message=awaitthis.addSingleIncomingMessage({
...commonAttributes,
// Even though this isn't reflected to the user, we want to place the last seen
// indicator above it. We set it to 'unread' to trigger that placement.
unread: READ_MESSAGE_STATE.unread,
source,
sent_at: timestamp,
received_at: timestamp,
});
}
}
@ -944,7 +942,7 @@ export class ConversationModel extends Backbone.Model<ConversationAttributes> {
// if change was made remotely, don't send it to the contact/group
if(fromSync||fromConfigMessage){
window.log.debug(
`WIP: updateExpireTimer() Not sending an ExpireTimerUpdate message because the change was made remotely receivedAt:${receivedAt} fromSync:${fromSync} fromConfigMessage:${fromConfigMessage}`
`WIP: updateExpireTimer() Not sending an ExpireTimerUpdate message because change was made remotely receivedAt:${receivedAt} fromSync:${fromSync} fromConfigMessage:${fromConfigMessage}`
);
return;
}
@ -966,10 +964,10 @@ export class ConversationModel extends Backbone.Model<ConversationAttributes> {
// TODO legacy messages support will be removed in a future release
// NOTE if the expirationMode is deleteAfterRead then legacy sync messages need to explicitly set the expirationStartTimestamp since they are alread marked as read
constlegacySyncMessageMustDisappearAfterRead=
expirationMode==='deleteAfterRead'&&
source===UserUtils.getOurPubKeyStrFromCache()&&
messageModel.get('type')==='outgoing';
// NOTE 2: Not sure about this code needs retested
// NOTE we don't use the expirationType directly from the Content Message because we need to resolve it to the correct convo type first in case it is legacy or has errors