fix: make sure to note sent another message

in all remote cases
pull/2971/head
William Grant 2 years ago
parent e8e3ba142e
commit 7c6e6c981a

@ -830,7 +830,7 @@ export class ConversationModel extends Backbone.Model<ConversationAttributes> {
let expirationType = providedExpirationType; let expirationType = providedExpirationType;
let expireTimer = providedExpireTimer; let expireTimer = providedExpireTimer;
const lastDisappearingMessageChangeTimestamp = providedChangeTimestamp; const lastDisappearingMessageChangeTimestamp = providedChangeTimestamp;
let source = providedSource; const source = providedSource || UserUtils.getOurPubKeyStrFromCache();
if (expirationType === undefined || expireTimer === undefined) { if (expirationType === undefined || expireTimer === undefined) {
expirationType = 'off'; expirationType = 'off';
@ -866,7 +866,6 @@ export class ConversationModel extends Backbone.Model<ConversationAttributes> {
} }
const isOutgoing = Boolean(!receivedAt); const isOutgoing = Boolean(!receivedAt);
source = source || UserUtils.getOurPubKeyStrFromCache();
// When we add a disappearing messages notification to the conversation, we want it // When we add a disappearing messages notification to the conversation, we want it
// to be above the message that initiated that change, hence the subtraction. // to be above the message that initiated that change, hence the subtraction.
@ -940,9 +939,9 @@ export class ConversationModel extends Backbone.Model<ConversationAttributes> {
} }
// if change was made remotely, don't send it to the contact/group // if change was made remotely, don't send it to the contact/group
if (fromSync || fromConfigMessage) { if (receivedAt || fromSync || fromConfigMessage) {
window.log.debug( window.log.debug(
`WIP: updateExpireTimer() Not sending an ExpireTimerUpdate message because change was made remotely receivedAt:${receivedAt} fromSync:${fromSync} fromConfigMessage:${fromConfigMessage} ` `WIP: updateExpireTimer() We dont send an ExpireTimerUpdate because this was a remote change receivedAt:${receivedAt} fromSync:${fromSync} fromConfigMessage:${fromConfigMessage} `
); );
return; return;
} }

@ -438,6 +438,7 @@ export async function handleMessageJob(
messageModel messageModel
)}\n\nexpirationTimerUpdate: ${JSON.stringify(expirationTimerUpdate)}` )}\n\nexpirationTimerUpdate: ${JSON.stringify(expirationTimerUpdate)}`
); );
confirm?.();
return; return;
} }
@ -456,6 +457,7 @@ export async function handleMessageJob(
messageModel messageModel
)}\n\nexpirationTimerUpdate: ${JSON.stringify(expirationTimerUpdate)}` )}\n\nexpirationTimerUpdate: ${JSON.stringify(expirationTimerUpdate)}`
); );
confirm?.();
return; return;
} }

@ -442,11 +442,12 @@ export async function checkForExpireUpdateInContentMessage(
convoToUpdate.get('lastDisappearingMessageChangeTimestamp') >= convoToUpdate.get('lastDisappearingMessageChangeTimestamp') >=
lastDisappearingMessageChangeTimestamp lastDisappearingMessageChangeTimestamp
) { ) {
window.log.info( // window.log.info(
`WIP: checkForExpireUpdateInContentMessage() This is an outdated disappearing message setting. So we will ignore it.\ncontent: ${JSON.stringify( // `WIP: checkForExpireUpdateInContentMessage() This is an outdated disappearing message setting. So we will ignore it.\ncontent: ${JSON.stringify(
content // content
)}\n\nconvoToUpdate: ${JSON.stringify(convoToUpdate)}` // )}
); // );
return { return {
expirationType: changeToDisappearingMessageType( expirationType: changeToDisappearingMessageType(
convoToUpdate, convoToUpdate,

Loading…
Cancel
Save