fix: sync legacy mode in single mode before V2

for NTS and closed groups we want to set the expirationMode to legacy
pull/2971/head
William Grant 2 years ago
parent bb646ed3b9
commit 674cda3278

@ -317,8 +317,14 @@ export async function handleNewClosedGroup(
); );
// TODO This is only applicable for old closed groups - will be removed in future // TODO This is only applicable for old closed groups - will be removed in future
// TODO legacy messages support will be removed in a future release
await groupConvo.updateExpireTimer({ await groupConvo.updateExpireTimer({
providedDisappearingMode: expireTimer === 0 ? 'off' : 'deleteAfterSend', providedDisappearingMode:
expireTimer === 0
? 'off'
: ReleasedFeatures.isDisappearMessageV2FeatureReleasedCached()
? 'deleteAfterSend'
: 'legacy',
providedExpireTimer: expireTimer, providedExpireTimer: expireTimer,
providedChangeTimestamp: GetNetworkTime.getNowWithNetworkOffset(), providedChangeTimestamp: GetNetworkTime.getNowWithNetworkOffset(),
providedSource: sender, providedSource: sender,

@ -230,10 +230,13 @@ async function handleUserProfileUpdate(result: IncomingConfResult): Promise<Inco
const wrapperNoteToSelfExpirySeconds = await UserConfigWrapperActions.getNoteToSelfExpiry(); const wrapperNoteToSelfExpirySeconds = await UserConfigWrapperActions.getNoteToSelfExpiry();
if (wrapperNoteToSelfExpirySeconds !== expireTimer) { if (wrapperNoteToSelfExpirySeconds !== expireTimer) {
// TODO legacy messages support will be removed in a future release
await ourConvo.updateExpireTimer({ await ourConvo.updateExpireTimer({
providedDisappearingMode: providedDisappearingMode:
wrapperNoteToSelfExpirySeconds && wrapperNoteToSelfExpirySeconds > 0 wrapperNoteToSelfExpirySeconds && wrapperNoteToSelfExpirySeconds > 0
? 'deleteAfterSend' ? ReleasedFeatures.isDisappearMessageV2FeatureReleasedCached()
? 'deleteAfterSend'
: 'legacy'
: 'off', : 'off',
providedExpireTimer: wrapperNoteToSelfExpirySeconds, providedExpireTimer: wrapperNoteToSelfExpirySeconds,
providedChangeTimestamp: result.latestEnvelopeTimestamp, providedChangeTimestamp: result.latestEnvelopeTimestamp,
@ -246,7 +249,9 @@ async function handleUserProfileUpdate(result: IncomingConfResult): Promise<Inco
window.log.debug( window.log.debug(
`WIP: [userProfileWrapper] updating disappearing messages to expiratonMode: ${ `WIP: [userProfileWrapper] updating disappearing messages to expiratonMode: ${
wrapperNoteToSelfExpirySeconds && wrapperNoteToSelfExpirySeconds > 0 wrapperNoteToSelfExpirySeconds && wrapperNoteToSelfExpirySeconds > 0
? 'deleteAfterSend' ? ReleasedFeatures.isDisappearMessageV2FeatureReleasedCached()
? 'deleteAfterSend'
: 'legacy'
: 'off' : 'off'
} wrapperNoteToSelfExpirySeconds: ${wrapperNoteToSelfExpirySeconds}` } wrapperNoteToSelfExpirySeconds: ${wrapperNoteToSelfExpirySeconds}`
); );

Loading…
Cancel
Save