mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-20 08:39:22 +01:00
Disallow marking users as registered without a UUID.
This commit is contained in:
committed by
Alex Hart
parent
665d9e31f6
commit
eb48ab1784
@@ -1129,7 +1129,7 @@ public class RecipientDatabase extends Database {
|
||||
*/
|
||||
public @NonNull Map<RecipientId, StorageId> getContactStorageSyncIdsMap() {
|
||||
SQLiteDatabase db = databaseHelper.getSignalReadableDatabase();
|
||||
String query = STORAGE_SERVICE_ID + " NOT NULL AND " + ID + " != ? AND " + GROUP_TYPE + " != ?";
|
||||
String query = STORAGE_SERVICE_ID + " NOT NULL AND " + UUID + " NOT NULL AND " + ID + " != ? AND " + GROUP_TYPE + " != ?";
|
||||
String[] args = SqlUtil.buildArgs(Recipient.self().getId(), String.valueOf(GroupType.SIGNAL_V2.getId()));
|
||||
Map<RecipientId, StorageId> out = new HashMap<>();
|
||||
|
||||
@@ -2112,21 +2112,6 @@ public class RecipientDatabase extends Database {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Marks the user as registered without providing a UUID. This should only be used when one
|
||||
* cannot be reasonably obtained. {@link #markRegistered(RecipientId, UUID)} should be strongly
|
||||
* preferred.
|
||||
*/
|
||||
public void markRegistered(@NonNull RecipientId id) {
|
||||
ContentValues contentValues = new ContentValues(1);
|
||||
contentValues.put(REGISTERED, RegisteredState.REGISTERED.getId());
|
||||
|
||||
if (update(id, contentValues)) {
|
||||
setStorageIdIfNotSet(id);
|
||||
Recipient.live(id).refresh();
|
||||
}
|
||||
}
|
||||
|
||||
public void markUnregistered(@NonNull RecipientId id) {
|
||||
ContentValues contentValues = new ContentValues(2);
|
||||
contentValues.put(REGISTERED, RegisteredState.NOT_REGISTERED.getId());
|
||||
|
||||
Reference in New Issue
Block a user