mirror of
https://github.com/oxen-io/session-android.git
synced 2025-01-12 17:43:38 +00:00
Make blocking take into account multi device
This commit is contained in:
parent
f97f4d071d
commit
68821b98aa
@ -52,6 +52,7 @@ import org.thoughtcrime.securesms.util.ListenableFutureTask;
|
|||||||
import org.thoughtcrime.securesms.util.TextSecurePreferences;
|
import org.thoughtcrime.securesms.util.TextSecurePreferences;
|
||||||
import org.thoughtcrime.securesms.util.Util;
|
import org.thoughtcrime.securesms.util.Util;
|
||||||
import org.whispersystems.libsignal.util.guava.Optional;
|
import org.whispersystems.libsignal.util.guava.Optional;
|
||||||
|
import org.whispersystems.signalservice.loki.protocol.multidevice.MultiDeviceProtocol;
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
@ -554,7 +555,12 @@ public class Recipient implements RecipientModifiedListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public synchronized boolean isBlocked() {
|
public synchronized boolean isBlocked() {
|
||||||
return blocked;
|
String masterPublicKey = MultiDeviceProtocol.shared.getMasterDevice(this.address.serialize());
|
||||||
|
if (masterPublicKey != null) {
|
||||||
|
return Recipient.from(context, Address.fromSerialized(masterPublicKey), false).blocked;
|
||||||
|
} else {
|
||||||
|
return blocked;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setBlocked(boolean blocked) {
|
public void setBlocked(boolean blocked) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user