Deprecate check for versioned expire timer capability

This commit is contained in:
ayumi-signal 2024-12-02 14:09:29 -08:00 committed by GitHub
parent 1dea35043d
commit a2bbfd9496
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 3 additions and 106 deletions

View file

@ -5383,7 +5383,7 @@ export class ConversationModel extends window.Backbone
if (!isDirectConversation(this.attributes)) {
return;
}
const { expireTimerVersion, capabilities } = this.attributes;
const { expireTimerVersion } = this.attributes;
// This should not happen in practice, but be ready to handle
if (expireTimerVersion >= MAX_EXPIRE_TIMER_VERSION) {
@ -5391,22 +5391,6 @@ export class ConversationModel extends window.Backbone
return;
}
if (expireTimerVersion <= 2) {
if (!capabilities?.versionedExpirationTimer) {
log.warn(`${logId}: missing recipient capability`);
return;
}
const me = window.ConversationController.getOurConversationOrThrow();
if (!me.get('capabilities')?.versionedExpirationTimer) {
log.warn(`${logId}: missing sender capability`);
return;
}
// Increment only if sender and receiver are both capable
} else {
// If we or them updated the timer version past 2 - we are both capable
}
const newVersion = expireTimerVersion + 1;
this.set('expireTimerVersion', newVersion);
await DataWriter.updateConversation(this.attributes);