New feature flag with ability to migrate GV1 groups

This commit is contained in:
Scott Nonnenberg
2020-12-01 08:42:35 -08:00
committed by GitHub
parent 089a6fb5a2
commit 2b8ae412e0
26 changed files with 608 additions and 189 deletions

View File

@@ -632,6 +632,13 @@ export class ConversationModel extends window.Backbone.Model<
window.Signal.Data.updateConversation(this.attributes);
}
isGroupV1AndDisabled(): boolean {
return (
this.isGroupV1() &&
window.Signal.RemoteConfig.isEnabled('desktop.disableGV1')
);
}
isBlocked(): boolean {
const uuid = this.get('uuid');
if (uuid) {
@@ -1181,6 +1188,7 @@ export class ConversationModel extends window.Backbone.Model<
isArchived: this.get('isArchived')!,
isBlocked: this.isBlocked(),
isMe: this.isMe(),
isGroupV1AndDisabled: this.isGroupV1AndDisabled(),
isPinned: this.get('isPinned'),
isMissingMandatoryProfileSharing: this.isMissingRequiredProfileSharing(),
isVerified: this.isVerified(),
@@ -4063,6 +4071,10 @@ export class ConversationModel extends window.Backbone.Model<
return true;
}
if (this.isGroupV1AndDisabled()) {
return false;
}
if (!this.isGroupV2()) {
return true;
}