Skip automigration of nameless groups.
This commit is contained in:
parent
d6061fb699
commit
c15ea8c0b4
2 changed files with 9 additions and 1 deletions
|
@ -101,6 +101,11 @@ public final class GroupsV1MigrationUtil {
|
|||
List<Recipient> possibleMembers = forced ? getMigratableManualMigrationMembers(registeredMembers)
|
||||
: getMigratableAutoMigrationMembers(registeredMembers);
|
||||
|
||||
if (!forced && !groupRecipient.hasName()) {
|
||||
Log.w(TAG, "Group has no name. Skipping auto-migration.");
|
||||
throw new InvalidMigrationStateException();
|
||||
}
|
||||
|
||||
if (!forced && possibleMembers.size() != registeredMembers.size()) {
|
||||
Log.w(TAG, "Not allowed to invite or leave registered users behind in an auto-migration! Skipping.");
|
||||
throw new InvalidMigrationStateException();
|
||||
|
|
|
@ -41,7 +41,6 @@ import org.thoughtcrime.securesms.phonenumbers.PhoneNumberFormatter;
|
|||
import org.thoughtcrime.securesms.profiles.ProfileName;
|
||||
import org.thoughtcrime.securesms.util.FeatureFlags;
|
||||
import org.thoughtcrime.securesms.util.StringUtil;
|
||||
import org.thoughtcrime.securesms.util.TextSecurePreferences;
|
||||
import org.thoughtcrime.securesms.util.Util;
|
||||
import org.thoughtcrime.securesms.wallpaper.ChatWallpaper;
|
||||
import org.whispersystems.libsignal.util.guava.Optional;
|
||||
|
@ -421,6 +420,10 @@ public class Recipient {
|
|||
}
|
||||
}
|
||||
|
||||
public boolean hasName() {
|
||||
return name != null;
|
||||
}
|
||||
|
||||
/**
|
||||
* False iff it {@link #getDisplayName} would fall back to e164, email or unknown.
|
||||
*/
|
||||
|
|
Loading…
Add table
Reference in a new issue