Refactor repeated use of the UserCapabilities constructor

This commit is contained in:
Ehren Kret
2021-05-13 12:08:59 -05:00
parent bfd2c32d4e
commit 57ff9f86f5
2 changed files with 12 additions and 15 deletions

View File

@@ -6,8 +6,17 @@
package org.whispersystems.textsecuregcm.entities;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.whispersystems.textsecuregcm.storage.Account;
public class UserCapabilities {
public static UserCapabilities createForAccount(Account account) {
return new UserCapabilities(
account.isGroupsV2Supported(),
account.isGv1MigrationSupported(),
account.isSenderKeySupported());
}
@JsonProperty
private boolean gv2;