mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-02-27 05:03:28 +00:00
Do not allow recipient merges to remove your own E164.
This would only happen in some niche change number cases where an unregistered device would continue to send sealed sender messages to you using your old number.
This commit is contained in:
@@ -1,29 +0,0 @@
|
||||
package org.thoughtcrime.securesms.keyvalue;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
public final class MockKeyValuePersistentStorage implements KeyValuePersistentStorage {
|
||||
|
||||
private final KeyValueDataSet dataSet;
|
||||
|
||||
public static KeyValuePersistentStorage withDataSet(@NonNull KeyValueDataSet dataSet) {
|
||||
return new MockKeyValuePersistentStorage(dataSet);
|
||||
}
|
||||
|
||||
private MockKeyValuePersistentStorage(@NonNull KeyValueDataSet dataSet) {
|
||||
this.dataSet = dataSet;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeDataSet(@NonNull KeyValueDataSet dataSet, @NonNull Collection<String> removes) {
|
||||
this.dataSet.putAll(dataSet);
|
||||
this.dataSet.removeAll(removes);
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NonNull KeyValueDataSet getDataSet() {
|
||||
return dataSet;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user